08 2019 档案

摘要:#include #include using namespace std; int main(void) { int n = 0; int ret[32]; int i = 0; cout > n; while (n != 0) { ret[i] = n % 2; n = n / 2; ... 阅读全文
posted @ 2019-08-30 23:46 你爱过大海我爱过你 阅读(1035) 评论(0) 推荐(0)
摘要:#include <iostream> #include <Windows.h> using namespace std; int main(void) { int a, b, c; for (int i = 100; i <= 999; i++) { a = i % 10; // 用变量i除10取余得到个位数 b = (i / 10) % 10; // 先对变量i除10,再对结果除10取余得到十 阅读全文
posted @ 2019-08-30 20:31 你爱过大海我爱过你 阅读(714) 评论(0) 推荐(0)
摘要:#include #include #include using namespace std; int main(void) { int width; for (int i = 1; i <= 9; i++) { for (int j = 1; j <= i; j++) { width = (j == 1) ? 1 : 2; ... 阅读全文
posted @ 2019-08-28 21:23 你爱过大海我爱过你 阅读(739) 评论(0) 推荐(0)
摘要:#include <iostream> #include <Windows.h> using namespace std; int main(void) { int row; cout << "请输入金字塔层数:"; cin >> row; for (int i = 1; i <= row; i++) { for (int k = 0; k < row - i; k++) { cout << " 阅读全文
posted @ 2019-08-28 20:47 你爱过大海我爱过你 阅读(273) 评论(0) 推荐(0)
摘要:#include <iostream> #include <Windows.h> using namespace std; int main(void) { int year; int month; int days = 0; bool flag; // 标记是否是闰年 cout << "请输入年份:"; cin >> year; cout << "请输入月份:"; cin >> month; / 阅读全文
posted @ 2019-08-18 11:50 你爱过大海我爱过你 阅读(3160) 评论(0) 推荐(0)
摘要:#include <iostream> #include <Windows.h> #include <string> using namespace std; int main(void) { char x; cout << "请输入一个字符:"; cin >> x; //利用ASCII码表中的字符排列规律进行字母的大小写转换 if (x >= 'a' && x <= 'z') { //小写字母 阅读全文
posted @ 2019-08-17 22:19 你爱过大海我爱过你 阅读(5545) 评论(0) 推荐(0)
摘要:我们在VS2017中如果使用C语言的scanf输入函数,编译的时候编译器会报error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprec 阅读全文
posted @ 2019-08-17 16:52 你爱过大海我爱过你 阅读(3125) 评论(3) 推荐(0)
摘要:C 语言字符串的比较 阅读全文
posted @ 2019-08-10 15:47 你爱过大海我爱过你 阅读(1474) 评论(0) 推荐(0)
摘要:C 统计用户输入的总行数和字符长度 阅读全文
posted @ 2019-08-10 13:39 你爱过大海我爱过你 阅读(219) 评论(0) 推荐(0)
摘要:C 循环统计输入的单词个数和字符长度 阅读全文
posted @ 2019-08-10 13:16 你爱过大海我爱过你 阅读(422) 评论(0) 推荐(0)
摘要:C++ 统计用户输入的总行数和字符长度 阅读全文
posted @ 2019-08-10 12:04 你爱过大海我爱过你 阅读(623) 评论(0) 推荐(0)