Skip to content

Commit 182b78a

Browse files
committed
aizu oj
1 parent 5ceaa78 commit 182b78a

File tree

17 files changed

+149
-0
lines changed

17 files changed

+149
-0
lines changed

AIZU/a.out

8.28 KB
Binary file not shown.

AIZU/branch.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <stdio.h>
2+
3+
int main(){
4+
5+
int a,b;
6+
scanf("%d %d",&a,&b);
7+
8+
if(a < b)
9+
printf("a < b\n");
10+
else if( a == b)
11+
printf("a == b\n");
12+
else
13+
printf("a > b\n");
14+
15+
return 0;
16+
}

AIZU/circle.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <stdio.h>
2+
3+
int main(){
4+
5+
int W, H, x, y, r;
6+
scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
7+
if(( (((x >= r) && (y >= r)) && (((W - r) >= x) && ((H - r) >= y)))) == 1)
8+
printf("Yes\n");
9+
else
10+
printf("No\n");
11+
12+
return 0;
13+
}

AIZU/divisor

8.28 KB
Binary file not shown.

AIZU/divisor.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <stdio.h>
2+
3+
int main(){
4+
int first, last ,num, i;
5+
i = 0;
6+
scanf("%d%d%d",&first, &last, &num);
7+
for(first;first <= last;first++){
8+
if(num%first == 0)
9+
i++;
10+
}
11+
printf("%d\n",i);
12+
13+
return 0;
14+
}

AIZU/print_test

8.28 KB
Binary file not shown.

AIZU/print_test.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <stdio.h>
2+
3+
int main(){
4+
5+
int i = 1;
6+
int x;
7+
8+
while(1){
9+
scanf("%d",&x);
10+
if(x == 0)
11+
break;
12+
printf("Case %d: %d\n",i++, x);
13+
}
14+
15+
return 0;
16+
17+
}

AIZU/range

8.28 KB
Binary file not shown.

AIZU/range.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <stdio.h>
2+
3+
int main(){
4+
5+
int a, b, c;
6+
scanf("%d %d %d", &a, &b, &c);
7+
8+
if(a < b && b < c)
9+
printf("Yes\n");
10+
else
11+
printf("No\n");
12+
13+
return 0;
14+
}

AIZU/rect

8.28 KB
Binary file not shown.

AIZU/rect.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <stdio.h>
2+
3+
int main(){
4+
5+
int retlong, retshort;
6+
scanf("%d %d", &retlong, &retshort);
7+
8+
printf("%d %d\n",retlong*retshort, 2*(retlong+retshort));
9+
10+
return 0;
11+
}

AIZU/sort3

8.23 KB
Binary file not shown.

AIZU/sort3.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <stdio.h>
2+
3+
int main(){
4+
5+
int a, b, c, temp;
6+
scanf("%d %d %d", &a, &b, &c);
7+
if(a > b){
8+
temp = a;
9+
a = b;
10+
b = temp;
11+
}
12+
if(b > c){
13+
temp = b;
14+
b = c;
15+
c = temp;
16+
}
17+
if(a > b){
18+
temp = a;
19+
a = b;
20+
b = temp;
21+
}
22+
23+
printf("%d %d %d\n", a, b, c);
24+
25+
return 0;
26+
27+
28+
}

AIZU/swaping_two_num.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <stdio.h>
2+
3+
int main(){
4+
5+
int a,b;
6+
7+
while(1){
8+
scanf("%d%d", &a, &b);
9+
if((a == 0) && (b == 0)){
10+
break;
11+
}
12+
if(a < b){
13+
printf("%d %d\n", a, b);
14+
}else {
15+
printf("%d %d\n", b, a);
16+
}
17+
}
18+
return 0;
19+
}

AIZU/watch

8.28 KB
Binary file not shown.

AIZU/watch.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <stdio.h>
2+
3+
int main(){
4+
5+
6+
int hours, minutes, seconds, total_sec;
7+
scanf("%d", &total_sec);
8+
minutes = total_sec/60;
9+
hours = minutes/60;
10+
seconds = total_sec%60;
11+
minutes = minutes%60;
12+
13+
14+
printf("%d:%d:%d\n",hours,minutes,seconds);
15+
16+
return 0;
17+
}

0 commit comments

Comments
 (0)