摘要:
#include <iostream> #include <string> #include <windows.h> using namespace std; int main() { string str; int i = 0; //访问字符数组的下标 int count = 0; cout <<
阅读全文
posted @ 2022-08-15 18:04
wshidaboss
阅读(98)
推荐(0)
摘要:
#include <iostream> #include <string> #include <windows.h>using namespace std; int main() { string line; int i = 0; //访问字符数组的下标 int count = 0; cout <<
阅读全文
posted @ 2022-08-15 15:33
wshidaboss
阅读(824)
推荐(0)
摘要:
1.for循环实现字符串逆置 #include <iostream> using namespace std; int main() { string str; cout << "请输入一个字符串:" << endl; cin >> str; int j = str.length() - 1; //
阅读全文
posted @ 2022-08-15 00:10
wshidaboss
阅读(475)
推荐(0)
摘要:
#include <iostream> #include <string> #include <windows.h> using namespace std; int main() { int count = 0; for (int i=0;i < 24; i++){ for (int j = 0;
阅读全文
posted @ 2022-08-14 18:13
wshidaboss
阅读(108)
推荐(0)
摘要:
1.while循环:#include <iostream> using namespace std; int main() { int b = 1; int sum = 0 ; while (b<101) { sum += b; b++; } cout << "总数为:" << sum << end
阅读全文
posted @ 2022-08-14 18:05
wshidaboss
阅读(1064)
推荐(0)
摘要:
#include <iostream> using namespace std; int main() { string name; string pwd; while (1) { system("cls"); cout << "请输入账号:"; cin >> name; cout << "请输入密
阅读全文
posted @ 2022-08-14 17:58
wshidaboss
阅读(383)
推荐(0)
摘要:
#include <iostream> #include <string> #include <windows.h> using namespace std; int main() { string word; int count = 0; int length = 0; cout << "请输入任
阅读全文
posted @ 2022-08-13 17:05
wshidaboss
阅读(458)
推荐(0)
摘要:
#include <iostream> #include <stdio.h> using namespace std; int main() { char x; cout << "请输入一个字母:" << endl; cin >> x; if (x >= 'a' && x <= 'z') { x =
阅读全文
posted @ 2022-08-13 15:38
wshidaboss
阅读(217)
推荐(0)
摘要:
#include <iostream> using namespace std; int main(void) { string word; int wordcount = 0; int length = 0; cout << "请输入若干个单词:" << endl; while (1) { if
阅读全文
posted @ 2022-08-13 15:34
wshidaboss
阅读(202)
推荐(0)
摘要:
方法一:#include <iostream> using namespace std; int main() { int row; cout << "请输入倒金字塔的行数:"; cin >> row; for (int i = row; i >= 1; i--) { for (int k = i;
阅读全文
posted @ 2022-08-12 22:56
wshidaboss
阅读(1169)
推荐(0)