728x90
# -*- coding: utf-8 -*-
# UTF-8 encoding when using korean
n = int(input())
a = input().split(' ')
max = int(a[0])
idx = 0
for i in range(n):
if(int(a[i])>max):
max = int(a[i])
idx = i
print(max, idx+1)
# -*- coding: utf-8 -*-
# UTF-8 encoding when using korean
n = int(input())
if(n<100):
n = n * (5 / 1000)
elif(100<=n and n<200):
n = n * (7 / 1000)
elif(200<=n and n<300):
n = n * (9 / 1000)
elif(300<=n):
n = n * (1 / 100)
print(format(n, ".2f"))
#include <iostream>
using namespace std;
int main() {
int n1,n2,n3,n4;
cin >> n1>>n2>>n3>>n4;
if(n2*2==n1+n3 && n3*2 == n2+n4){
int d = n2 - n1;
cout << n4+d;
}
if(n2 * n2== n1*n3 && n3 * n3 == n2*n4){
int r = n2 / n1;
cout << n4 * r;
}
return 0;
}
728x90
'Algorithm > goorm' 카테고리의 다른 글
goorm 가위바위보, 홀수 놀이, 멀티탭 사용 (0) | 2020.09.07 |
---|---|
goorm 문자열 번갈아 출력하기, 벡터의 +, - 연산, 구구단+ (0) | 2020.09.06 |
goorm 삼각형의 넓이 2, 막대기, 평균과 평균보다 큰 수, 암스트롱 수(Narcissistic Number) (0) | 2020.09.04 |
goorm 두 점 사이의 거리, n 구하기 (0) | 2020.09.03 |
goorm 최단거리, 좀비런, 재정 위기 (0) | 2020.09.01 |