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; ...
阅读全文
摘要:#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取余得到十
阅读全文
摘要:#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; ...
阅读全文
摘要:#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 << "
阅读全文
摘要:#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; /
阅读全文
摘要:#include <iostream> #include <Windows.h> #include <string> using namespace std; int main(void) { char x; cout << "请输入一个字符:"; cin >> x; //利用ASCII码表中的字符排列规律进行字母的大小写转换 if (x >= 'a' && x <= 'z') { //小写字母
阅读全文
摘要:我们在VS2017中如果使用C语言的scanf输入函数,编译的时候编译器会报error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprec
阅读全文
摘要:C 循环统计输入的单词个数和字符长度
阅读全文
摘要:C++ 统计用户输入的总行数和字符长度
阅读全文
浙公网安备 33010602011771号