Test FromNum~TermNum output can divide into divisor
来源:互联网 发布:windows核心编程 源码 编辑:程序博客网 时间:2024/05/21 17:00
Need to do as follows
1> every line have lineNum
2> show the number that can't divide into divisor; if the number can't divide into the divisor, then replace it by <SPACE>
continue_test.c
#include<stdio.h> #define fromNum 1 #define termNum 30 #deine divisor 2 #define lineNum 5 int main(int argc, char *agrv[]){ int number, flag; for(number = fromNum, flag = 0; number <= termNum; flag++, number++) { if(!(flag%lineNum) && flag) { printf("\n"); } if(!(number%divisor)) { printf(" "); continue; } else printf(" %02d ", number); } printf("\n");}Makefile
make: gcc -o swit_test swit_test.c clean: rm -rf swit_testThe Result as follows
[root@localhost switch_test]# ./swit_test 01 03 05 07 09 11 13 15 17 19 21 23 25 27 29
PS. this program can be extension from the define
- Test FromNum~TermNum output can divide into divisor
- 【sqlserver】merge into test
- rbd file input output test
- How to convert smartform output into pdf?
- select * into test2 from test
- Step into Scala - 32 - Test
- How to divide a data set into equal size buckets
- Divide a list of numbers into group of consecutive numbers
- WUST OJ 1481: divide into groups(二分)
- How can I output simple debugging messages
- output the unit test log files
- can't convert ActiveRecord::RecordInvalid into String
- Using setJavaScriptEnabled can Introduce XSS Vulnerabilities into&
- Divide
- [学习SQL SERVER 2005系列]关于INSERT、UPDATE 或 DELETE的OUTPUT及OUTPUT...INTO...用法
- SQL Server--OUTPUT及OUTPUT...INTO... 在 INSERT、UPDATE 或 DELETE的用法
- SQL Server--OUTPUT及OUTPUT...INTO... 在 INSERT、UPDATE 或 DELETE的用法
- javax.imageio.IIOException: Can't create output stream!
- 如何解决"应用程序无法启动,因为应用程序的并行配置不正确"问题
- 实现数据库到excel文件的下载
- 改运营商显示名称的详细教程
- 简单OA项目笔记(1):MyEclipse添加SSH支持
- 实现图片上传不超过2M
- Test FromNum~TermNum output can divide into divisor
- Smarty变量调节器
- ajax百度词条
- 变量调节器(实例)
- html5百度百科
- 【文本相似度】在数据库中如何查找相似的记录
- AJAX数据的处理
- 变量调节器
- Smarty__if