-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnabeatsu.cs
More file actions
40 lines (36 loc) · 910 Bytes
/
nabeatsu.cs
File metadata and controls
40 lines (36 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// 世界のナベアツプログラム
// 1~1000に拡張
// New create 2024/7/24
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Nabeatsu
{
class Program
{
static void Main(string[] args)
{
int flag1 = 0;
for(int i=1;i<=1000;i++){
if(i % 3 == 0){
flag1 += 1;
}
if(i % 10 == 3){
flag1 += 1;
}
if(i / 10 % 10 == 3){
flag1 += 1;
}
if(i / 100 == 3){
flag1 += 1;
}
if(flag1 > 0){
Console.WriteLine(i);
}
flag1 = 0;
}
}
}
}