- 博客(14)
- 收藏
- 关注
原创 随机猜数字
#include <iostream>using namespace std;#include <stdlib.h>#include <time.h>int main(){ srand(time(NULL)); // 使用系统当前时间设置随机数种子 int data = rand() % 100 + 1; // 生成一个随机数 int key = 0; while (true) { cout << "请输入一个数字>"; c.
2021-10-01 17:50:25
185
原创 输出1-100能被3整除的数,并求他们的总和。
#include<iostream>using namespace std;int main(){ int i = 1; int sum = 0; for (; i <= 100; ++i) { if (i % 3 == 0) { cout << i << endl; sum = sum + i; } } cout << sum << endl; return 0;}..
2021-10-01 12:55:46
6147
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人