/*
#include <stdio.h>
int main()
{
long long int a;
scanf("%lld",&a);
printf("%lld",a+1);
return 0;
}
산술연산자 + - * / %
비교연산자 > < >= <= == !=
int a, b;
scanf("%d %d",&a, &b);
printf("%d",a+b);
printf("%d",a<b);
1. 비교연산의 결과는 1 또는 0으로만 나온다~
2. >= <= != 항상 =을 오른쪽에!
a>=b (o)
a=>b (x)
3.
== vs =
a==10 (비교) a와 10이 같나요?
a=10; (대입) a에 10을 대입해.
*/
/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d",a>b);
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int x,y;
scanf("%d %d",&x,&y);
printf("%d",x==y);
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int x,y;
scanf("%d %d",&x,&y);
printf("%d",x<=y);
return 0;
}
*/
/*
#include <stdio.h>
int main ()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d",a!=b);
return 0;
}
논리연산자 ! && ||
-> 논리값으로만 연산 (1 or 0)
1. not !
!1 0
!0 1
printf("%d",!a);
2. and && (양쪽 다 1일때만 1)
a 8 b 10
a>10 && b==10
a b a&&b
0 0 0
0 1 0
1 0 0
1 1 1
3. or || (둘 중 하나라도 1이면 1)
a b a||b
0 0 0
0 1 1
1 0 1
1 1 1
*/
/*
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
printf("%d",!a);
return 0;
}
*/
/*
#include <stdio.h>
int main ()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d",a&&b);
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d",a||b);
return 0;
}
삼항연산자 = 3항연산자
조건식 ? 조건식이1일때의값 : 조건식이0일때의값
조건식 ( 결과가 1 또는 0으로 나오는 식)
printf("%d", 123>456 ? 10 : 20); // 20
-> 둘 중 큰 수 ? 작은 수 ?
printf("%d", a>b ? a : b); //둘 중 큰 수
printf("%d", a<b ? a : b); //둘 중 작은 수
a, b, c 중 가장 작은 수 ??
(a,b중 작은수?) 와 c중 작은 수 ?
*/
/*
#include <stdio.h>
int main()
{
int x,y;
scanf("%d %d",&x,&y);
printf("%d",x>y?x:y);
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d",(a<b?a:b)<c ? (a<b?a:b):c);
return 0;
}
조건식 : 결과가 1또는 0으로 나오는 식
조건문
1. if-else 90%
2. switch-case 10%
if (조건식1)
{
명령1;
}
-> 만약 조건식이 참이라면 명령1을 실행하세요
else if(조건식2)
{
명령2;
}
-> 조건식1이 거짓이면서, 조건식2가 참이면 명령2를 실행하세요
..
else
{
명령3;
}
-> 위의 모든 조건이 거짓이라면 명령3을 실행하세요
*/
/*
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
if(a<0)
{
printf("추워요");
}
else if(0<=a && a<10)
{
printf("쌀쌀해요");
}
else if(a<30)
{
printf("별로안추워요");
}
else
{
printf("더워요");
}
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
if(a<10)
{
printf("small");
}
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
if(a<10)
{
printf("small");
}
else if(a>=10)
{
printf("big");
}
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
if(a<b)
{
printf("%d",b-a);
}
else
{
printf("%d",a-b);
}
return 0;
}
*/