/*
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
}
c의 data type 자료형
정수 int %d
long long int %lld
실수 float %f
double %lf
문자 char %c
overflow
int a;
printf("%lld",(long long int)a); 강제형변환 (casting)
산술연산자 + - * / %
int a, b;
printf("%d",a+b); // overflow발생 가능성!!
printf("%lld",(long long int)a+b);
*/
/*#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%lld",(long long int)a+b);
return 0;
}*/
/*#include <stdio.h>
int main()
{
long long int a,b;
scanf("%lld %lld",&a,&b);
printf("%lld",a+b);
return 0;
}*/
/*#include<stdio.h>
int main()
{
long long int a;
scanf("%lld",&a);
printf("%lld",-a);
return 0;
}
a+b
a-b
a*b
a/b
a%b
int + int -> int
정수 + 정수 -> 정수
정수 / 정수 -> 정수
10 / 3 -> 3 (정수몫)
(float)a / b -> a를 b로 나눈 실수 값
%f -> 3.333333
%.2f -> 3.33
정수 % 정수 -> 정수 나머지
10 %3 -> 1 %d
1042 1043 1044 1045 1046
*/
/*
#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;
}*/
/*
#include<stdio.h>
int main()
{
long long int a;
scanf("%lld",&a);
printf("%lld",++a);
return 0;
}
int : -2147483648 ~ +2147483647
*/
/*#include<stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%lld\n",(long long int)a+b);
printf("%d\n",a-b);
printf("%lld\n",(long long int)a*b);
printf("%d\n",a/b);
printf("%d\n",a%b);
printf("%.2f\n",(float)a/b);
return 0;
}*/
/*
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%lld\n",(long long int)a+b+c);
printf("%.1f",(a+b+c)/3.0);
return 0;
}*/
/*#include<stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d+%d=%d\n",a,b,a+b);
printf("%d-%d=%d\n",a,b,a-b);
printf("%d*%d=%d\n",a,b,a*b);
printf("%d/%d=%d\n",a,b,a/b);
return 0;
}
*/
/*# include<stdio.h>
int main()
{
float a,b;
scanf("%f %f",&a,&b);
printf("%.2f",a*b);
return 0;
}*/
/*#include<stdio.h>
int main()
{
int c;
scanf("%d",&c);
printf("%d %d",c/60,c%60);
return 0;
}
true 참 0이 아닌 모든 수
false 거짓 0
산술연산자 + - * / %
비교연산자 > < >= <= == !=
1. 비교연산의 결과는 1 또는 0
printf("%d",a>b); //a가 b보다 크면 1 아니면 0
2. >= <= != =을 항상 오른쪽
a=>b (x)
a>=b (o)
3. = vs ==
a==1 (비교) a와 1이 같니?
a=1; (대입) a에 1을 대입해.
a+1; (x)
a = a+1; -> a++; 1049 ~1052
*/
/*
#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;
}*/
/*#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;
}
논리값 1 or 0
논리연산
! && ||
!1 0
!0 1
!90 0
&&
a b a&&b
0 0 0
0 1 0
1 0 0
1 1 1
90 && 8 1
||
a b a||b
0 0 0
0 1 1
1 0 1
1 1 1
1053 1056
*/
/*#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;
}
*/
/*#include<stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d",(a&&!b)||(!a&&b));
return 0;
}
int a=0;
00000000 00000000 00000000 00000000
int b=1;
00000000 00000000 00000000 00000001
int c=2;
00000000 00000000 00000000 00000010
**************************************
int a=3;
int b=10;
00000000 00000000 00000000 00000011
00000000 00000000 00000000 00001010
00000000 00000000 00000000 00000010
00000000 00000000 00000000 00001011
a&&b true && true 1
a&b 2
a||b true || true 1
a|b 11
!a !true 0
~a 1100 -4
xor 비트단위로 서로 다르면 1 같으면 0
a^b 9
1059~1062
*/
/*#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;
}*/
/*#include<stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
printf("%d",a^b);
return 0;
}
삼항연산
!a 단항연산자
a+b a>b 다항연산자 (이항연산자)
( 조건식 ) ? ( ) : ( )
조건식 : 결과가 1 또는 0으로 나오는 식
int c;
c = 123>456 ? 777 : 888 ;
printf("%d",123>456 ? 777 : 888);
printf("%d",c);
"가장 큰수, 가장 작은 수 "
max = a>b?a:b;
min = a<b?a:b;
if(a>b)
{
max=a;
}
else
{
max=b;
}
*/
/*#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d %d",&a,&b);
c = a>b?a:b;
printf("%d",c);
return 0;
}
*/
/*
#include<stdio.h>
int main()
{
int a,b,c,d,e;
scanf("%d %d %d",&a,&b,&c);
d=a<b?a:b;
e=d<c?d:c;
printf("%d",e);
return 0;
}
#include<stdio.h>
int main()
{
int a;
scanf("%d",&a);
if(a>=1000)
{
if()
{
printf("hello");
}
else
{
printf(" sffwe");
}
}
else if(a>=500)
{
printf("hi");
}
else if()
{
}
else
{
printf("bye....");
}
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 {
printf("big");
}
return 0;
}*/
/*#include<stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
if(a>b){
printf("%d",a-b);
}
else {
printf("%d",b-a);
}
return 0;
}*/
#include<stdio.h>
/*int main()
{
int a;
scanf("%d",&a);
if(a%7==0)
{
printf("multiple");
}
else{
printf("not multiple");
}
return 0;
}
*/