일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 비즈네르
- 안티 디스어셈블
- dll(이)가 없어 프로그램을 시작할 수 없습니다
- rev-basic
- static link
- Reverse Engineering
- 리버싱
- 써니나타스
- c언어
- PEfileFormat
- Anti Disassemble
- 세특
- 고전암호
- Delphi
- reversing
- suninatas
- 문제풀이
- 스키테일
- codegate2022
- webhacking.kr
- Dreamhack
- 델파이
- 드림핵
- 웹해킹
- 다른 사람 컴퓨터에서 내가 만든 프로그램 실행시키는 법
- wargame.kr
- 양자암호
- HackThisSite
- CodeEngn
- wargame
- Today
- Total
👾
[Pwnable Study] 1주차 과제 - 백준 본문
I. 입출력과 사칙연산
[2552] Hello World
[C99]
#include <stdio.h>
int main(void){
printf("Hello World!");
return 0;
}
[C++17]
#include <iostream>
int main(){
std::cout<<"Hello World!";
return 0;
}
[Python3]
print("Hello World!")
[1000] A+B
//C99
#include <stdio.h>
int main(void){
int a, b = 0;
scanf("%d %d", &a, &b);
printf("%d", a+b);
return 0;
}
[C++17]
//C++17
#include <iostream>
int main(){
int a, b = 0;
std::cin>>a;
std::cin>>b;
std::cout<<a+b;
return 0;
}
[Python3]
a, b = map(int, input().split())
print(a+b)
[1001] A-B
[C99]
#include <stdio.h>
int main(void){
int a, b = 0;
scanf("%d %d", &a, &b);
printf("%d", a-b);
return 0;
}
[C++17]
#include <iostream>
int main(){
int a, b = 0;
std::cin>>a;
std::cin>>b;
std::cout<<a-b;
return 0;
}
[Python3]
a, b = map(int, input().split())
print(a-b)
[10998] AxB
[C99]
#include <stdio.h>
int main(void){
int a, b = 0;
scanf("%d %d", &a, &b);
printf("%d", a*b);
return 0;
}
[C++17]
#include <iostream>
int main(){
int a, b;
std::cin>>a;
std::cin>>b;
std::cout<<a*b;
return 0;
}
[Python3]
a, b = map(int, input().split())
print(a*b)
[1008] A/B
[C99]
#include <stdio.h>
int main(void){
int a, b = 0;
scanf("%d %d", &a, &b);
printf("%.9lf", (double)a/(double)b);
return 0;
}
[C++17]
#include <iostream>
int main(){
int a, b = 0;
std::cin>>a;
std::cin>>b;
printf("%.9lf", (double)a/(double)b);
return 0;
}
[Python3]
a, b = input().split()
a = float(a)
b = float(b)
print(round(a/b, 9))
[10869] 사칙연산
[C99]
#include <stdio.h>
int main(void){
int a, b = 0;
scanf("%d %d", &a, &b);
printf("%d\n", a+b);
printf("%d\n", a-b);
printf("%d\n", a*b);
printf("%d\n", a/b);
printf("%d", a%b);
return 0;
}
[C++17]
#include <iostream>
int main(){
int a, b;
std::cin>>a;
std::cin>>b;
std::cout<<a+b<<std::endl;
std::cout<<a-b<<std::endl;
std::cout<<a*b<<std::endl;
std::cout<<a/b<<std::endl;
std::cout<<a%b;
return 0;
}
[Python3]
a, b = map(int, input().split())
print(a+b)
print(a-b)
print(a*b)
print(int(a/b))
print(a%b)
[10926] ??!
[C99]
#include <stdio.h>
int main(void){
char str[50] = {0, };
scanf("%s", str);
printf("%s??!", str);
return 0;
}
[C++17]
#include <iostream>
#include <string>
int main(){
std::string str;
std::cin>>str;
std::cout<<str<<"??!";
return 0;
}
[Python3]
print(input() + '??!')
[18108] 1998년생인 내가 태국에서는 2541년생?!
[C99]
#include <stdio.h>
int main(void){
int year;
scanf("%d", &year);
printf("%d", year-543);
return 0;
}
[C++17]
#include <iostream>
using namespace std;
int main(){
int year;
cin>>year;
cout<<year-543;
return 0;
}
[Python3]
year = input()
year = int(year)
print(year-543);
[3003] 킹, 퀸, 룩, 비숍, 나이트, 폰
[C99]
#include <stdio.h>
int main(void){
int k, q, r, b, n, p = 0;
scanf("%d %d %d %d %d %d", &k, &q, &r, &b, &n, &p);
printf("%d %d %d %d %d %d", 1-k, 1-q, 2-r, 2-b, 2-n, 8-p);
return 0;
}
[C++17]
#include <iostream>
using namespace std;
int main(){
int k, q, r, b, n, p = 0;
cin>>k;
cin>>q;
cin>>r;
cin>>b;
cin>>n;
cin>>p;
cout<<1-k<<" "<<1-q<<" "<<2-r<<" "<<2-b<<" "<<2-n<<" "<<8-p;
return 0;
}
[Python3]
ar = [1, 1, 2, 2, 2, 8]
asdf= list(map(int, input().split()))
for i in range(6):
print(ar[i]-asdf[i], end=' ')
[10430] 나머지
[C99]
#include <stdio.h>
int main(void){
int a, b, c = 0;
scanf("%d %d %d", &a, &b, &c);
printf("%d\n", (a+b)%c);
printf("%d\n", ((a%c)+(b%c))%c);
printf("%d\n", (a*b)%c);
printf("%d", ((a%c)*(b%c))%c);
return 0;
}
[C++17]
#include <iostream>
using namespace std;
int main(){
int a, b, c;
cin>>a;
cin>>b;
cin>>c;
cout<<(a+b)%c<<endl<<((a%c)+(b%c))%c<<endl<<(a*b)%c<<endl<<((a%c)*(b%c))%c;
return 0;
}
[Python3]
a, b, c = map(int, input().split())
print((a+b)%c)
print(((a%c)+(b%c))%c);
print((a*b)%c);
print(((a%c)*(b%c))%c);
[2588] 곱셈
[C99]
#include <stdio.h>
int main(void){
int a, b = 0;
scanf("%d %d", &a, &b);
printf("%d\n", a*(b%10));
printf("%d\n", a*((b%100)-(b%10))/10);
printf("%d\n", a*(b/100));
printf("%d\n", a*b);
return 0;
}
[C++17]
#include <iostream>
using namespace std;
int main(){
int a, b = 0;
cin>>a;
cin>>b;
cout<<a*(b%10)<<endl<<a*((b%100)-(b%10))/10<<endl<<a*(b/100)<<endl<<a*b;
return 0;
}
[Python3]
a = int(input())
b = input()
print(a*int(b[2]))
print(a*int(b[1]))
print(a*int(b[0]))
print(a*int(b))
[10171] 고양이
[C99]
#include <stdio.h>
int main(void){
printf("\\ /\\\n");
printf(" ) ( ')\n");
printf("( / )\n");
printf(" \\(__)|\n");
return 0;
}
[C++17]
#include <iostream>
using namespace std;
int main(){
cout<<"\\ /\\\n"<<" ) ( ')\n"<<"( / )\n"<<" \\(__)|";
return 0;
}
[Python3]
print("\\ /\\")
print(" ) ( ')")
print("( / )")
print(" \\(__)|")
[10172] 개
[C99]
#include <stdio.h>
int main(void){
printf("|\\_/|\n");
printf("|q p| /}\n");
printf("( 0 )\"\"\"\\\n");
printf("|\"^\"\` |\n");
printf("||_/=\\\\__|");
return 0;
}
[C++17]
#include <iostream>
using namespace std;
int main(){
cout<<"|\\_/|\n"<<"|q p| /}\n"<<"( 0 )\"\"\"\\\n"<<"|\"^\"\` |\n"<<"||_/=\\\\__|";
return 0;
}
[Python3]
print("|\\_/|")
print("|q p| /}")
print('( 0 )"""\\')
print('|"^"` |')
print("||_/=\\\\__|")
[25083] 새싹
[C99]
#include <stdio.h>
int main(void){
printf(" ,r\'\"7\n");
printf("r\`-_ ,\' ,/\n");
printf(" \\. \". L_r\'\n");
printf(" \`~\\/\n");
printf(" |\n");
printf(" |\n");
return 0;
}
[C++17]
#include <iostream>
using namespace std;
int main(){
cout<<" ,r\'\"7\n"<<"r\`-_ ,\' ,/\n"<<" \\. \". L_r\'\n"<<" \`~\\/\n"<<" |\n"<<" |";
return 0;
}
[Python3]
print(" ,r'\"7")
print("r`-_ ,' ,/")
print(" \\. \". L_r'")
print(" `~\\/")
print(" |")
print(" |")
II. 조건문
[1330] 두 수 비교하기
[C99]
#include <stdio.h>
int main(void){
int a, b;
scanf("%d %d", &a, &b);
if(a == b){
printf("==");
}else if(a>b){
printf(">");
}else{
printf("<");
}
return 0;
}
[C++17]
#include <iostream>
using namespace std;
int main(){
int a, b;
cin>>a;
cin>>b;
if(a>b){
cout<<">";
}else if(a == b){
cout<<"==";
}else{
cout<<"<";
}
}
[Python3]
a, b = map(int, input().split())
if a==b:
print("==");
elif a>b:
print(">");
else:
print("<");
[9498] 시험 성적
[C99]
#include <stdio.h>
int main(void){
int g = 0;
scanf("%d", &g);
if(g<= 100 && g >= 90){
printf("A");
}else if(g<= 89 && g>=80){
printf("B");
}else if(g<=79 && g>= 70){
printf("C");
}else if(g<=69 && g>= 60){
printf("D");
}else{
printf("F");
}
}
[C++17]
#include <iostream>
using namespace std;
int main(){
int g;
cin>>g;
if(g <= 100 && g >= 90){
cout<<"A";
}else if(g <= 89 && g >= 80){
cout<<"B";
}else if(g <= 79 && g >= 70){
cout<<"C";
}else if(g <= 69 && g >= 60){
cout<<"D";
}else{
cout<<"F";
}
}
[Python3]
g = int(input())
if g<=100 and g>= 90:
print("A")
elif g<=89 and g>= 80:
print("B")
elif g<=79 and g>= 70:
print("C")
elif g<=69 and g>= 60:
print("D")
else:
print("F")
[2753] 윤년
[C99]
#include <stdio.h>
int isLeapYear(int year){
if((year%4 == 0) && (((year%400) == 0) || (year%100) != 0)){
return 1;
}else return 0;
}
int main(){
int year;
scanf("%d", &year);
printf("%d", isLeapYear(year));
return 0;
}
[C++17]
#include <iostream>
using namespace std;
bool isLeapYear(int year){
if((year%4 == 0) && (((year%400) == 0) || (year%100) != 0)){
return 1;
}else return 0;
}
int main(){
int year;
cin>>year;
cout<<isLeapYear(year);
}
[Python3]
year = int(input())
if (year%4) == 0 and (((year%400) == 0 or (year%100) != 0)):
print('1')
else:
print('0')
[14681] 사분면 고르기
[C99]
#include <stdio.h>
int quadrant(int x, int y){
if(x<0){
if(y<0){
return 3;
}else{
return 2;
}
}else{
if(y<0){
return 4;
}else{
return 1;
}
}
}
int main(void){
int x, y;
scanf("%d %d", &x, &y);
printf("%d", quadrant(x, y));
return 0;
}
[C++17]
#include <iostream>
using namespace std;
int quadrant(int x, int y){
if(x<0){
if(y<0){
return 3;
}else{
return 2;
}
}else{
if(y<0){
return 4;
}else{
return 1;
}
}
}
int main(){
int x, y = 0;
cin>>x;
cin>>y;
cout<<quadrant(x, y);
}
[Python3]
x = int(input())
y = int(input())
if x>0 and y>0:
print('1')
elif x>0 and y<0:
print('4')
elif x<0 and y>0:
print('2')
else:
print('3')
[2884] 알람 시계
[C99]
#include <stdio.h>
int main(void){
int h, m = 0;
scanf("%d %d", &h, &m);
if(m<45){
if(h>=1){
printf("%d %d", h-1, m+15);
}else{
printf("23 %d", m+15);
}
}else{
printf("%d %d", h, m-45);
}
}
[C++17]
#include <iostream>
using namespace std;
int main(void){
int h, m = 0;
cin>>h;
cin>>m;
if(m<45){
if(h>=1){
cout<<(h-1)<<" "<<(m+15);
}else{
cout<<"23 "<<(m+15);
}
}else{
cout<<h<<" "<<(m-45);
}
}
[Python3]
h, m = map(int, input().split())
if m < 45:
if h >= 1:
print(h-1, m+15)
elif h < 1:
print(23, m+15)
else:
print(h, m-45)
[2525] 오븐 시계
[C99]
#include <stdio.h>
int main(void){
int h, m, t;
scanf("%d %d %d", &h, &m, &t);
if(m + t < 60){
m += t;
}else{
if(h + (m+t)/60 > 23){
h += (m+t)/60 - 24;
}else{
h += (m+t)/60;
}
m = (m+t)%60;
}
printf("%d %d", h, m);
}
[C++17]
#include <iostream>
using namespace std;
int main(){
int h, m, t;
cin>>h;
cin>>m;
cin>>t;
if(m + t < 60){
m += t;
}else{
if(h + (m+t)/60 > 23){
h += (m+t)/60 - 24;
}else{
h += (m+t)/60;
}
m = (m+t)%60;
}
cout<<h<<" "<<m;
}
[Python3]
h, m = map(int, input().split())
t = int(input())
if m+t < 60:
m += t
else:
if (h+((m+t)//60)) > 23:
h += (m+t)//60 - 24
else:
h += (m+t)//60
m = (m+t)%60
print("%d %d" % (h, m))
[2480] 주사위 세개
[C99]
#include <stdio.h>
int main(void){
int a, b, c = 0;
int max = 0;
scanf("%d %d %d", &a, &b, &c);
if((a == b)&&(b == c)){
printf("%d", 10000+(a*1000));
}else if(a == b){
printf("%d", 1000 + (a*100));
}else if(b == c){
printf("%d", 1000 + (b*100));
}else if(a == c){
printf("%d", 1000 + (c*100));
}else{
max = a;
if(b > max) max = b;
if(c > max) max = c;
printf("%d", max*100);
}
}
[C++17]
#include <iostream>
using namespace std;
int main(){
int a, b, c = 0;
int max = 0;
cin>>a;
cin>>b;
cin>>c;
if((a == b)&&(b == c)){
cout<<10000+(a*1000);
}else if(a == b){
cout<<1000+(a*100);
}else if(b == c){
cout<<1000 + (b*100);
}else if(a == c){
cout<<1000+(c*100);
}else{
max = a;
if(b > max) max = b;
if(c > max) max = c;
cout<<max*100;
}
}
[Python3]
a, b, c = map(int, input().split())
max = a
if (a==b) and (b==c):
print(10000 + 1000*a)
elif (a==b):
print(1000+a*100)
elif (c==b):
print(1000+b*100)
elif (a==c):
print(1000+c*100)
else:
if b > max:
max = b
if c > max:
max = c
print(max*100)