This commit is contained in:
2025-07-31 15:59:44 +08:00
parent a13b6d38c8
commit c6a123ad95
2 changed files with 9 additions and 13 deletions

0
.gitignore vendored Normal file
View File

View File

@@ -1,17 +1,13 @@
#include <iostream> #include <iostream>
using namespace std; using namespace std;
int main() {
/* struct Node{
要求:编写程序,输出 1-50 之间所有能被 3 整除的数字,并统计其个数 int first;
*/ int second;
int count = 0; };
for (int i = 1; i <= 50; i++) {
if (i % 3 == 0) {
cout << i << " "; int main(){
count++;
}
}
cout << endl;
cout << count << endl;
} }