coding----1wcods----坚持第5天----758行
来源:互联网 发布:excel中删除重复数据 编辑:程序博客网 时间:2024/05/22 09:01
#include <stdio.h>#include <errno.h>#include <stdlib.h>#include <string.h>int main(int argc, char *argv[]){if (argc == 1) {fprintf(stderr, "usage: %s <errno> [<errno> ...]\n", argv[0]);exit(1);}else {int i;for (i = 1; i < argc; ++i) {int ec = strtoul(argv[i], 0, 0);fprintf(stdout, "OS error code %d: %s\n", ec, strerror(ec));}exit(0);}}#include <iostream>int main () { int val = val;//这样是可以的但是,并没有初始化 std::cout << val << std::endl; std::cout << "*/" << std::endl; std::cout << "/*" << std::endl; //std::cout << /* "*/" */; std::cout << /* "*/" */" << std::endl; int v1, v2; std::cin >> v1 >> v2; std::cout << "The suam of " << v1 << " and " << v2 << \ " is:" << v1 + v2 << std::endl; int sum = 0, value = 1; // keep executing the while until value is greater than 10 while (value <= 10) { sum += value; //assigns sum + value to sum value ++; // add 1 to value } std::cout << "sum of 1 and 10 inclusive is :" << sum <<std::endl; sum = 0; for (int i = 1; i <= 10; i++) { sum += i; } // test the variate i // std::cout << i << std::endl; // -fpremsive std::cout << "sum of 1 and 10 inclusive is :" << sum <<std::endl; sum = 0; for (int i = -100;i <= 100; i++) { sum += i; } std::cout << "sum of 1 and 10 inclusive is :" << sum <<std::endl; sum = 0; for (int i = 50;i <= 100;i ++) { sum += i; } std::cout << "sum of 50 and 100 inclusive is :" << sum <<std::endl; sum = 0; int i = 50; while (i <= 100) { sum += i; i ++; } std::cout << "sum of 50 and 100 inclusive is :" << sum <<std::endl; sum = 0; for (int i = 10;i >= 0;i --) { sum +=i; } std::cout << "sum of 10 and 1 inclusive is :" << sum <<std::endl; sum = 0; i = 10; while (i >= 0) { sum += i; i --; } std::cout << "sum of 10 and 1 inclusive is :" << sum <<std::endl; std::cout << "enter into two number for comparing :" << sum <<std::endl; std::cin >> v1 >> v2; std::cout << "the max number is :" << (v1 > v2 ? v1:v2) <<std::endl; /* int count = 0; while (std::cin >> value) { if(value < 0) count ++; } std::cout << "amount of all nagetive number is :" << count <<std::endl;*/ int lower, upper, count; std::cout << "v1 ---- v2 " << std::endl; std::cin >> v1 >> v2; if (v1 > v2) { upper = v1; lower = v2; }else { upper = v2; lower = v1; } for (value = lower, count = 1; value <= upper; value ++,count ++) { std::cout << value ; if (count % 10 == 0) { std::cout<<std::endl; } } return 0; }
0 0
- coding----1wcods----坚持第5天----758行
- coding----1wcods----坚持第1天----111行
- coding----1wcods----坚持第2天----239行
- coding----1wcods----坚持第3天----352行
- coding----1wcods----坚持第4天----635行
- coding----1wcods----坚持第6天----988行
- coding----1wcods----坚持第7天----1152行
- coding----1wcods----坚持第8天----1316行
- coding----1wcods----坚持第9天----1737行
- coding----1wcods----坚持第9天----1807行
- 坚持#第107天~坚持!
- 坚持#第5天~深奥的知识
- 坚持#第243天~shell脚本5
- 坚持#第19天~
- 坚持#第42天~
- 坚持#第43天~
- 坚持#第44天~
- 坚持#第45天~
- 最近学hibernate总感觉用着不爽,于是就想学mybatis和大家交流下
- ZOJ-2185
- 学长们的求职血泪史(C/C++/JAVA)
- Java IO文件编码转换
- 求64位能表示的最大斐波那契数
- coding----1wcods----坚持第5天----758行
- source Insight
- 研发者角度看用户体验 --“第四届用户体验(HiUED)峰会”有感
- ios draw NSMutableAttributedString
- CocoaPods 导入第三方库头文件自动补齐
- 约瑟夫环问题(josephus problem)详解
- 【android,16】android 视频播放器
- 关于setitimer
- 关于TNSNAMES.ORA中SERVICE_NAME,SID的一点理解