#include <stdio.h>
#pragma warning(disable:4996)
int main()
{
int a,b=1,c=0;
char d;
while(1){
printf("Hello!\n");
printf("1) 사칙연산\n");
printf("2) 팩토리얼\n");
printf("3) 세제곱\n");
scanf("%d",&a);
if(a == 1)
{
while(1){
scanf("%d",&b);
if(b==-1)
{
break;
}
else
{
scanf("%c %d",&d,&c);
switch(d){
case '+':
printf("%d\n",b+c);
break;
case '-':
printf("%d\n",b-c);
break;
case '/':
printf("%d\n",b/c);
break;
default:
printf("%d\n",b*c);
break;
}
}
}
}
else if(a==2)
{
while(1)
{
scanf("%d",&c);
if(c==-1)
{
break;
}
else
{
while(c>=1)
{
b *= c;
c--;
}
printf("%d\n",b);
b = 1;
}
}
}
else
{
while(1){
scanf("%d",&b);
if(b==-1)
{
break;
}
else
{
c = b*b*b;
printf("%d\n",c);
}
}
}
}
return 0;
}
#include <stdio.h>
#pragma warning(disable:4996)
int main()
{
float i = 10;
float b;
while(i>-11)
{
if(i==0){
i--;
continue;
}
else
{
b = 10/i;
printf("%f\n",b);
i--;
}
}
return 0;
}
#include <stdio.h>
#pragma warning(disable:4996)
int main()
{
int a,b,c;
scanf("%d %d",&a,&b);
while(1)
{
if(a%b==0){
printf("%d\n",b);
break;
}
if(a>=b)
{
c = b;
b = a % b;
a = c;
}
else
{
c = b;
b = a;
a = c;
continue;
}
}
return 0;
}