bdfgdfg

3046번,5564번,8393번 본문

코딩테스트/백준

3046번,5564번,8393번

marmelo12 2021. 9. 12. 16:20
반응형
#include <iostream>
using namespace std;

int main()
{
    int r1,s;
    cin >> r1 >> s;
    cout << (2 * s) - r1;
    return 0;
}

3046번

 

#include <iostream>
using namespace std;

int main()
{
    int a,b,c,d;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    cout << (a + b + c + d) / 60 << endl << (a + b + c + d) % 60;
    return 0;
}

5546번

#include <iostream>
using namespace std;

int main()
{
    int a,sum = 0;
    cin >> a;
    for(int i = 1; i <= a; ++i)
        sum += i;
    cout << sum;
    return 0;
}
반응형

'코딩테스트 > 백준' 카테고리의 다른 글

2530번,2588번  (0) 2021.09.25
2480번, 2525번  (0) 2021.09.17
2845번, 2914번, 3003번  (0) 2021.09.09
1000,1001,1550번 문제  (0) 2021.09.08
sovled.ac  (0) 2021.09.08
Comments