- 博客(13)
- 资源 (6)
- 收藏
- 关注
原创 新手入门篇(Helloworld, A+Bproblem)
1.Helloworld输出helloworld#include <iostream>using namespace std;int main( ) { cout << "Hello World!" << endl; return 0;}2.A+Bproblem输入A,B,输出A+B#include <iostream>using namespace std;int main( ) { int a,
2022-05-29 16:32:13 174
原创 交换a,b
题目大意:给定两个变量a,b, 请交换a,b两个变量的值并输出。多种解法(禁止抄袭):#include <iostream>using namespace std;int main( ) { int a,b; cin >> a >> b; int c = a; a = b; b = c; cout << a << b << endl; return 0;}
2022-05-21 09:33:59 75
原创 数码和(简单)
#include <iostream>using namespace std;int count( int n) { int total = 0; while (n!=0) { total += n % 10; n /= 10; } return n;}int main( ) { int n; cin >> n; for (int i = 1; i <= n; i++) {.
2022-05-21 09:23:37 109
原创 质数(C++)
相信关于质数的题目大家也看过很多遍了吧,不过在这里我还是要帮大家整理一下。质数:只能被自身或1整除的数判断质数的函数:#include <iostream>using namespace std;bool prime(int n) { if (n < 2) return false; for (int i = 2; i*i <= n; i++ ) { if (n % i == 0) return false; } r
2022-05-10 19:12:45 1471
原创 Hello world
相信这道题应该不会有人不会吧,但是抱着试一试的心态,看看有没有人点赞#include <studio>using namespace std;int main( ) { cout << "hello world" << endl; //有时候要求可能会变,注意灵活 return 0;}点赞……...
2022-05-07 20:15:09 50
原创 A+B problem
本题是初学者的第2题(第一题:hello world),虽然可能没有人会看,但我还是写个答案吧(不唯一)#include <iostream>using namespace std;int main( ) { int a,b; cin >> a >> b; cout << a + b; return 0; //完美收工}如果有意见请告诉我(^_^)...
2022-05-07 20:08:52 52
标答第二季,之前做不出来我的资源的现在可以有答案啦!!!
2022-06-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人