1020

#include <stdio.h>
int main()
{
    int a, b;
    scanf("%d-%d", &a, &b);
    printf("%06d%07d\\n", a, b);
    return 0;
}

1021

#include <stdio.h>

char main()
{
    char data[51]="";
    scanf("%s", &data);
    printf("%s\\n", data);
    return 0;
}

1022

#include <stdio.h>

char main()
{
    char data[2001]="";
    fgets(data, 2000, stdin);
    printf("%s\\n", data);
    return 0;
}

1023

#include <stdio.h>

int main()
{
    int a,b;
    scanf("%d.%d", &a, &b);
    printf("%d\\n%d\\n", a, b);
    return 0;
}

1024

#include <stdio.h>

int main()
{
    int i;
    char d[30];
    scanf("%s", d);
    for(i=0; d[i]!='\\0'; i++)
    {
        printf("\\'%c\\'\\n", d[i]);
    }
}

1025

#include <stdio.h>

int main()
{
    int a, b, c, d, e;
    scanf("%1d %1d %1d %1d %1d", &a, &b, &c, &d, &e);
    printf("[%d]\\n", a*10000);
    printf("[%d]\\n", b*1000);
    printf("[%d]\\n", c*100);
    printf("[%d]\\n", d*10);
    printf("[%d]\\n", e);
    
}

1026

#include <stdio.h>

int main()
{
    int h, m, s;
    
    scanf("%d:%d:%d", &h, &m, &s);
    printf("%d \\n", m);
    return 0;
}

1027

#include <stdio.h>

int main()
{
    int y, m, d;

    scanf("%04d.%02d.%02d", &y, &m, &d);
    printf("%02d-%02d-%04d \\n", d, m, y);
    return 0;
}

1028

#include <stdio.h>

int main()
{
    unsigned int n;

    scanf("%u", &n);
    printf("%u \\n", n);
    return 0;
}

1029

#include <stdio.h>

int main()
{
    double d;

    scanf("%lf", &d);
    printf("%.11lf \\n", d);
    return 0;
}

1030

#include <stdio.h>

int main()
{
    long long int n;

    scanf("%lld", &n);
    printf("%lld \\n", n);
    return 0;
}

1031

#include <stdio.h>

int main()
{
    int n;

    scanf("%d", &n);
    printf("%o \\n", n);
    return 0;
}

1032

#include <stdio.h>

int main()
{
    int n;

    scanf("%d", &n);
    printf("%x \\n", n);
    return 0;
}

1033

#include <stdio.h>

int main()
{
    int n;

    scanf("%d", &n);
    printf("%X\\n", n);
    return 0;
}

1034

#include <stdio.h>

int main()
{
    int n;

    scanf("%o", &n);
    printf("%d\\n", n);
    return 0;
}

1035

#include <stdio.h>

int main()
{
    int n;
    
    scanf("%x", &n);
    printf("%o\\n", n);
    return 0;
}

1036

#include <stdio.h>

int main()
{
    char n;

    scanf("%c", &n);
    printf("%d\\n", n);
    return 0;
}

1037

#include <stdio.h>

int main()
{
    int n;

    scanf("%d", &n);
    printf("%c\\n", n);
    return 0;
}

1038

#include <stdio.h>

int main()
{
    long long int n, a;

    scanf("%lld %lld", &n, &a);
    printf("%lld\\n", n+a);
    return 0;
}

1039

#include <stdio.h>

int main()
{
    long long int n, a;

    scanf("%lld %lld", &n, &a);
    printf("%lld\\n", n+a);
    return 0;
}

'study > C , C++' 카테고리의 다른 글

코드업 C언어 기초 100제 1001~1019  (0) 2023.02.13

6081

n = int(input(), 16)
for i in range(1, 16):
    print('%X'%n, '*%X'%i, '=%X'%(n*i), sep='')

6082

i = int(input())
for h in range(1, i+1):
    if h%10==3 or h%10==6 or h%10==9:
        print("X", end=' ')
    else:
        print(h, end=' ')

6083

r, g, b = map(int, input().split())
num = 0

for i in range(0, r):
    for j in range(0, g):
        for h in range(0, b):
            print(i, j, h)
            
            num+=1
print(num)

6084

h, b, c, s = map(int, input().split())
space = (h*b*c*s)/8/1024/1024

print(round(space, 1) ,"MB")

h, b, c, s = map(int, input().split())
space = (h*b*c*s)/8/1024/1024

print(format(space, ".1f"), "MB")

6085

#반올림이 아닌 소수점 2자리까지 표기하는거인듯
#전에 했던 코드처럼 입력했더니 0.00으로 나와야하는 값이 0.0으로 출력됨

w, h, b = map(int, input().split())
space = ((w*h*b)/8/1024/1024)

print(format(space, ".2f"), "MB")

6086

n = int(input())
s,c = 0,1

while True:
    s += c 
    c += 1
    if s >= n:
        break

print(s)

6087

n = int(input())

for i in range(1, n+1):
    if i%3 == 0:
        continue
    print(i, end=' ')

6088

a, d, n = map(int, input().split())
count = 1 #a+b부터가 2번째 숫자여서 처음값을 1로 설정

while True:
    a += d 
    count += 1
    if count == n:
        break

print(a)

6089

a, r, n = map(int, input().split())
count = 1 

while True:
    a *= r 
    count += 1
    if count == n:
        break

print(a)

6090

a, m, d, n = map(int, input().split())
count = 1 

for i in range(n-1):
    a = a*m+d
print(a)

#첫번째, 즉 range에서 0은 처음 지정한 a의 값이 아닌 계산된 2번째 수열이 해당되기 때문에 range(n-1)임
#range(n)으로 했을 때 출력결과는 -1 3 -5 11 -21  임

6091

a, b, c = map(int, input().split())
d = 1

while True:
    if d%a==0 and d%b==0 and d%c==0:
        break
    d += 1

print(d)

#문제 제공코드 사용 - 더 빠름
a, b, c = map(int, input().split())
d = 1

while d%a!=0 or d%b!=0 or d%c!=0:
    d += 1
print(d)

6092

n = int(input())
a = input().split()

for i in range(n):
    a[i] = int(a[i])

d = []
for i in range(24):
    d.append(0)

for i in range(n):
    d[a[i]] += 1

for i in range(1, 24):
    print(d[i], end = ' ')

6093

#문제에 제공된 코드 사용
n = int(input())
k = input().split()

for i in range(n-1, -1, -1):
    print(k[i], end=' ')

#다른풀이
n = int(input())
k = input().split()

a = list(reversed(k))
b = list(map(int, a))
c = str(b)[1:-1]
print(c.replace(",",""))

6094

n = int(input())
k = map(int, input().split())

print(min(k))

6095

d = [[0 for j in range(20)] for i in range(20)]

n = int(input())
for i in range(n):
    x, y = input().split()
    d[int(x)][int(y)] = 1

for i in range(1, 20):
    for j in range(1, 20):
        print(d[i][j], end=' ')
    print()


d = []
for i in range(20):
    d.append([])
    for j in range(20):
        d[i].append(0)

n = int(input())
for i in range(n):
    x, y = input().split()
    d[int(x)][int(y)] = 1

for i in range(1, 20):
    for j in range(1, 20):
        print(d[i][j], end=' ')
    print()

6096

d = []
for i in range(20):
    d.append([])
    for j in range(20):
        d[i].append(0)

for i in range(1, 20):
    data = input().split()
    for j in range(1, 20):
        d[i][j] = int(data[j-1]) 
        
n = int(input())

for i in range(n):
    x,y = input().split()
    for j in range(1,20):
        if d[j][int(y)]==1:
            d[j][int(y)]=0
        else:
            d[j][int(y)]=1

        if d[int(x)][j]==1:
            d[int(x)][j]=0
        else:
            d[int(x)][j]=1

for i in range(1, 20):
    for j in range(1, 20):
        print(d[i][j], end=' ')
    print()

6097

h, w = map(int, input().split())

a = []
for i in range(h):
    a.append([])
    for j in range(w):
        a[i].append(0)

n = int(input())

for i in range(n):
    l, d, x, y = map(int,input().split())
    for j in range(l):
        a[int(x-1)][int(y-1)] = 1
        if d == 1:
            x += 1
        elif d == 0:
            y += 1

for i in range(h):
    for j in range(w):
        print(a[i][j], end=' ')
    print()

6098

d = [[0 for j in range(10)] for i in range(10)]

for i in range(10):
    d[i] = list(map(int, input().split()))

x = 1
y = 1

while True:
    if d[x][y] == 0:
        d[x][y] = 9
    if d[x][y] == 2:
        d[x][y] = 9
        break
    if d[x][y+1] == 1 and d[x+1][y] == 1:
        break
    if d[x][y+1] != 1:
        y += 1
    elif d[x+1][y] != 1:
        x += 1

for i in range(10):
    for j in range(10):
        print(d[i][j], end=' ')
    print()

6060

i, h = map(int, input().split())
print(int(i&h))

6061

i, h = map(int, input().split())
print(int(i|h))

6062

i, h = map(int, input().split())
print(int(i^h))

6063

i, h = map(int, input().split())
print(i if (i>h) else h)

i, h = map(int, input().split())
print(i if (i>=h) else h)

6064

i, h, j = map(int, input().split())
print((i if i<h else h) if ((i if i<h else h)<j) else j)

6065

i, h, j = map(int, input().split())
if i%2==0:
    print(i)
if h%2==0:
    print(h)
if j%2==0:
    print(j)

6066

i, h, j = map(int, input().split())
if i%2==0:
    print("even")
else:
    print("odd")
if h%2==0:
    print("even")
else:
    print("odd")
if j%2==0:
    print("even")
else:
    print("odd")

6067

i = int(input())
if i<0 :
    if i%2==0:
        print('A')
    else:
        print('B')
else:
    if i%2==0:
        print('C')
    else:
        print('D')

6068

i = int(input())
if i>=90:
    print('A')
else:
    if i>=70:
        print('B')
    else:
        if i>=40:
            print('C')
        else:
            print('D')

6069

i = input()
if i=='A':
    print('best!!!')
elif i=='B':
    print('good!!')
elif i=='C':
    print('run!')
elif i=='D':
    print('slowly~')
else:
    print('what?')

6070

i = int(input())
if i//3==1:
    print('spring')
elif i//3==2:
    print('summer')
elif i//3==3:
    print('fall')
else:
    print('winter')

6071

n = 3 
while n!=0 :
  n = int(input())
  if n!=0 :
    print(n)

6072

n = int(input())
while n!=0:
    print(n)
    n = n-1

6073

i = int(input())
while i!=0:
    print(i-1)
    i = i-1

6074

i = ord(input())
h = ord('a')
while h<=i:
    print(chr(h), end=' ')
    h += 1

6075

i = int(input())
h = int('0')
while h<=i:
    print(int(h))
    h+=1

6076

i = int(input())
h = int('0')
while h<=i:
    print(int(h))
    h+=1

6077

i, h = 2, 0 
a = int(input())
while i <= a:
  h += i 
  i += 2 
print (h)

6078

i = ''
while i!='q':
    i = input()
    print(i)

6079

i = int(input())
h, j = 0, 0
while j<i :
  h+=1
  j+=h  

print(h)

6040

i, h = input().split()
i = int(i)
h = int(h)
print(i//h)

6041

i, h = input().split()
i = int(i)
h = int(h)
print(i%h)

6042

i = input()
i = float(i)
print(format(i, '.2f'))

6043

i1, i2 = input().split()
i1 = float(i1)
i2 = float(i2)
print(format(i1/i2, '.3f'))

6044

i, h = input().split()
i = int(i)
h = int(h)
print(i+h)
print(i-h)
print(i*h)
print(i//h)
print(i%h)
print(format(i/h, '.2f'))

6045

i, h, j = map(int, input().split())
print(i+h+j, format((i+h+j)/3, '.2f'))

6046

i = int(input())
print(i<<1)

6047

i, h = map(int, input().split())
print(i<<h)

6048

i, h = map(int, input().split())
print(i<h)

6049

i, h = map(int, input().split())
print(i==h)

6050

i, h = map(int, input().split())
print(i<=h)

6051

i, h = map(int, input().split())
print(i!=h)

6052

i = int(input())
print(i!=0)

6053

i = bool(int(input()))
print(not i)

6054

i, h = input().split()
print(bool(int(i)) and bool(int(h)))

6055

i, h = input().split()
print(bool(int(i)) or bool(int(h)))

6056

i, h = input().split()
i = bool(int(i))
h = bool(int(h))
print((i and (not h)) or ((not i) and h))

6057

i, h = input().split()
i = bool(int(i))
h = bool(int(h))
print(((not i) and (not h)) or (i and h))

6058

i, h = input().split()
i = bool(int(i))
h = bool(int(h))
print(not(i or h))

6059

i = int(input())
i = ~i 
print(int(i))

6020

i, h= input().split('-')
print(i, h, sep='')

6021

i = input()
print(i[0])
print(i[1])
print(i[2])
print(i[3])
print(i[4])

6022

i = input()
print(i[0:2], i[2:4], i[4:6])

6023

i, h, j = input().split(':')
print(h)

6024

i, h = input().split()
j = i + h
print(j)

6025

i, h = input().split()
j = int(i) + int(h)
print(j)

6026

i = input()
h = input()
i = float(i)
h = float(h)
print(i + h)

6027

i = input()
i = int(i)
print('%x' %i)

6028

i = input()
i = int(i)
print('%X' %i)

6029

i = input()
h = int(i, 16)
print('%o' %h)

6030

i = ord(input())
print(i)

6031

i = int(input())
print(chr(i))

6032

i = int(input())
print(-i)

6033

i = input()
i = ord(i)
print(chr(i+1))

6034

i, h = input().split()
i = int(i)
h = int(h)
print(i-h)

6035

i1, i2 = input().split()
i1 = float(i1)
i2 = float(i2)
print(i1 * i2)

6036

i, h = input().split()
print(i*int(h))

6037

i = input()
h = input()
print(int(i)*h)

6038

i, h = input().split()
i = int(i)
h = int(h)
print(i**h)

6039

i1, i2 = input().split()
i1 = float(i1)
i2 = float(i2)
print(i1**i2)

 

6001

print('Hello')

6002

print('Hello', 'World')

6003

print('Hello')
print('World')

6004

print("'Hello'")

6005

print('"Hello World"')

6006

print('\"!@#$%^&*()\'')

6007

print('\"C:\\Download\\\'hello\'.py\"')

6008

print('print(\"Hello\\nWorld\")')

6009 

i = input()
print(i)

6010

i = input()
i = int(i)
print(i)

 

6011

i = input()
i = float(i)
print(i)

6012

i = input()
h = input()

i = int(i)
h = int(h)

print(i)
print(h)

6013

i = input()
h = input()

print(h)
print(i)

6014

i = input()
i = float(i)
print(i)
print(i)
print(i)

6015

i, h = input().split()
i = int(i)
h = int(h)
print(i)
print(h)

6016

i, h = input().split()
print(h, i)

6017

i = input()
print(i, i, i)

6018

i, h = input().split(':')
print(i, h, sep=':')

6019

y, m, d = input().split('.')
print(d, m, y, sep='-')