/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d", &a, &b);
if(b==2){
if(a%4==0 && a%100!=0 || a%400==0){
printf("29");
}
else{
printf("28");
}
}
else if(b == 4||b == 6||b == 9||b == 11){
printf("30");
}
else{
printf("31");
}
return 0;
}
#include <stdio.h>
int main()
{
int n,m;
scanf("%d",&n);
m=((n%10)*10+n/10)*2%100;
printf("%d\n",m);
if(m<=50){
printf("GOOD");
}
else {
printf("OH MY GOD");
}
return 0;
}
#include <stdio.h>
int main()
{
int y,m,d,x;
scanf("%d %d %d", &y,&m,&d);
x=(y+m+d)/100%2;
if(x==0) printf("대박");
else printf("그럭저럭");
return 0;
}
#include <stdio.h>
int main()
{
int age,y;
scanf("%d",&age);
y = 2013 - age;
if (y>= 2000) printf("%d %d",y%100, 3);
else printf("%d %d",y%100, 1);
return 0;
}
#include <stdio.h>
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if((a+b)>c){
if(a==c) printf("정삼각형");
else if (a==b || b==c) printf("이등변삼각형");
else if ((a*a + b*b)==c*c) printf("직각삼각형");
else printf("삼각형");
}
else printf("삼각형아님");
return 0;
}
#include <stdio.h>
int main()
{
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
double f,g;
f = (double) a/b;
g = (double) c/d;
if(f>g) printf(">");
else if(f<g) printf("<");
else printf("=");
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a<=170) printf("CRASH %d",a);
else{
if (b<=170) printf("CRASH %d",b);
else{
if (c<=170) printf("CRASH %d",c);
else printf("PASS");
}
}
return 0;
}
조건문
if-else
switch-case
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
if(a==10||a==12||a==13)
{
printf("hello");
printf("world");
}
else if(a==20)
{
printf("rainy");
}
else
{
printf("hot");
}
printf("\n");
switch(a)
{
case 10 :
case 12 :
case 13 : printf("hello"); printf("world"); break;
case 20 : printf("rainy"); break;
default : printf("hot"); break;
}
}
*/
/*
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
switch (a/10)
{
case 10 :
case 9 : printf("A");break;
case 8 :
case 7 : printf("B");break;
case 6 :
case 5 :
case 4 : printf("C");break;
default : printf("D");break;
}
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
char a;
scanf("%c",&a);
switch (a)
{
case 'A' : printf("best!!!");break;
case 'B' : printf("good!!");break;
case 'C' : printf("run!");break;
case 'D' : printf("slowly~");break;
default : printf("what?");break;
}
return 0;
}
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
switch (a/3)
{
case 1 : printf("spring");break;
case 2 : printf("summer");break;
case 3 : printf("fall");break;
default : printf("winter");break;
}
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
switch (a+b+c+d)
{
case 1 : printf("도");break;
case 2 : printf("개");break;
case 3 : printf("걸");break;
case 4 : printf("윷");break;
default : printf("모");break;
}
return 0;
}
#include <stdio.h>
int main()
{
int a,b;
char c;
scanf("%d%c%d",&a,&c,&b);
switch(c)
{
case '+' : printf("%d",a+b);break;
case '-' : printf("%d",a-b);break;
case '*' : printf("%d",a*b);break;
default : printf("%.2f",(float) a/b);break;
}
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d-%d",&a,&b);
int c = b/1000000;
int year,y,m,d;
y = a/10000;
m = a%10000/100;
d = a%100;
switch(c)
{
case 1 : year=1900+y; printf("%d/%02d/%02d M",year,m,d);break;
case 3 : year=2000+y; printf("%d/%02d/%02d M",year,m,d);break;
case 2 : year=1900+y; printf("%d/%02d/%02d F",year,m,d);break;
case 4 : year=2000+y; printf("%d/%02d/%02d F",year,m,d);break;
}
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d-%d",&a,&b);
int c = b/1000000;
int y = a/10000;
int m = a%10000/100;
int d = a%100;
if(c==1 || c==3)
{
if (c==1) printf("%d",y+1900);
else printf("%d",y+2000);
printf("/%02d/%02d M",m,d);
}
else {
if (c==2) printf("%d",y+1900);
else printf("%d",y+2000);
printf("/%02d/%02d F",m,d);
}
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d-%d",&a,&b);
int c = b/1000000;
int y = a/10000;
int m = a%10000/100;
int d = a%100;
switch (c/3)
{
case 1 : printf("%d",y+2000);break;
default : printf("%d",y+1900);break;
}
printf("/%02d/%02d",m,d);
if (c==1 || c==3) printf(" M");
else printf(" F");
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d-%d",&a,&b);
int c = b/1000000;
int y = a/10000;
int m = a%10000/100;
int d = a%100;
switch (c/3)
{
case 1 : printf("%d",y+2000);break;
default : printf("%d",y+1900);break;
}
printf("/%02d/%02d",m,d);
if (c%2==1) printf(" M");
else printf(" F");
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d-%d",&a,&b);
int c = b/1000000;
int y = a/10000;
int m = a%10000/100;
int d = a%100;
if (c/3 == 1) printf("%d",y+2000);
else printf("%d",y+1900);
printf("/%02d/%02d",m,d);
if (c%2==1) printf(" M");
else printf(" F");
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int H,h,M,m,n,l,k;
scanf("%d %d\n%d",&h,&m,&n);
l = n/60;
k = n%60;
M = k + m;
H = l + h;
if (M>=60){
M = M-60;
H = H + 1;
}
if (H>=24) H = H - 24;
printf("%d %d", H,M);
}
*/
/*
#include <stdio.h>
int main()
{
int h,m,n;
scanf("%d %d\n%d",&h,&m,&n);
m = n%60 + m;
h = n/60 + h;
if (m>=60){
m = m - 60;
h = h + 1;
}
if (h>=24) h = h - 24;
printf("%d %d", h,m);
}
*/
//#include <stdio.h>
//int main()
//{
// char num[16];
// scanf("%s",num);
// if (num[7]==1 || num[7]==3) printf("19%c%c/%c%c/%c%c %c",num[0],num[1],num[2],num[3],num[4],num[5],num[7] == '1' ? 'M' : 'W');
// else printf("20%c%c/%c%c/%c%c %c",num[0],num[1],num[2],num[3],num[4],num[5],num[7] == '3' ? 'M' : 'W');
// return 0;
//}
/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d-%d",&a,&b);
int c = b/1000000;
int y = a/10000;
int m = a%10000/100;
int d = a%100;
printf("%d",c/3==1?y+2000:y+1900);
printf("/%02d/%02d",m,d);
printf(" %c",c%2==1?'M':'F');
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a+b<=c||b+c<=a||c+a<=b) printf("no");
else printf("yes");
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a+b>c&&b+c>a&&c+a>b) printf("yes");
else printf("no");
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int h,m,n;
scanf("%d %d\n%d",&h,&m,&n);
m = n%60 + m;
h = n/60 + h;
if (m>=60) h = h + 1;
printf("%d %d", h%24,m%60);
}
*/
#include <stdio.h>
int main()
{
int h,m,n;
int hh,mm;
scanf("%d %d\n%d",&h,&m,&n);
mm=m+n;
hh = (h+mm/60)%24;
printf("%d %d", hh,mm%60);
return 0;
}
a, b, c
x, y, z
i, j, k
p, q, r
결과 result -> res
합 sum or s
갯수 count -> cnt or c
최대값 max or m
최소값 min or m
임시공간 temp or tmp or t