Node
This commit is contained in:
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
@@ -1,17 +1,13 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
|
||||
struct Node{
|
||||
int first;
|
||||
int second;
|
||||
};
|
||||
|
||||
|
||||
int main(){
|
||||
/*
|
||||
要求:编写程序,输出 1-50 之间所有能被 3 整除的数字,并统计其个数
|
||||
*/
|
||||
int count = 0;
|
||||
for (int i = 1; i <= 50; i++) {
|
||||
if (i % 3 == 0) {
|
||||
cout << i << " ";
|
||||
count++;
|
||||
}
|
||||
}
|
||||
cout << endl;
|
||||
cout << count << endl;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user