#include <stdio.h>
#include <stdlib.h>
/*
int main()
{
printf("Hello world!\n");
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
double a,b,c,d;
scanf("%lf %lf",&a,&b);
if(a<150)
{
c=a-100;
}
else if(a>=150 && a<160)
{
c=(a-150)/2+50;
}
else
{
c=(a-100)*0.9;
}
d=(b-c)*100/c;
if(d<=10)
{
printf("정상");
}
else if(d>10 && d<=20)
{
printf("과체중");
}
else
{
printf("비만");
}
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b,c,d;
scanf("%d %d",&a,&b);
c=90-a;
d=c/5;
if(c%5==0)
{
printf("%d",b+d);
}
else
{
printf("%d",b+d+1);
}
return 0;
}
a 12345
a/10 1234
a%10 5
a/1000 12
a%1000 345
*/
/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d",&a);
b=2012-a+1;
if(b<2000)
{
printf("%d 1",b%100);
}
else
{
printf("%d 3",b%100);
}
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b,c,d,e;
scanf("%d",&a);
b=a/10;
c=a%10;
d=c*10;
e=(d+b)*2;
if(e<=50)
{
printf("%d \nGOOD",e);
}
else if (e>=100 && e%100<=50)
{
printf("%d \nGOOD",e%100);
}
else if (e>=100 && e%100>50)
{
printf("%d \nOH MY GOD",e%100);
}
else if (e>50)
{
printf("%d \nOH MY GOD",e);
}
return 0;
}
조건문
1. if-else
2. switch-case
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
if(a==10||a==15)
printf("i want to go home..");
else if(a==20)
printf("i want to sleep..");
else
printf("Study hard!!");
switch(a)
{
case 10 :
case 15 : printf("i want to go home.."); break;
case 20 : printf("i want to sleep.."); break;
default : printf("Study hard!!"); break;
}
}
*/
/*
#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 0 : printf("모"); break;
case 1 : printf("도"); break;
case 2 : printf("개"); break;
case 3 : printf("걸"); break;
case 4 : printf("윷"); break;
}
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
}
*/
#include <stdio.h>
int main()
{
char c;
int a,b;
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;
case '/' :printf("%.2lf",(double)a/b); break;
}
return 0;
}