This commit is contained in:
2025-07-31 13:38:36 +08:00
parent 5b8f959777
commit a13b6d38c8
2 changed files with 20 additions and 11 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "3224733E-16AC-4D1B-89D1-0C06F06AB765"
type = "1"
version = "2.0">
</Bucket>

View File

@@ -1,14 +1,17 @@
//
// main.cpp
// test01
//
// Created by Leo on 2025/6/21.
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
std::cout << "Hello, World!\n";
return 0;
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;
}