VioletaBabel
12791번: Starman 본문
#include<cstdio>
#include<utility>
#include<string>
#include<iostream>
using namespace std;
int main()
{
int t, x, y, count = 0;
pair<int, string> db[25];
db[0].first = 1967;
db[0].second = "DavidBowie";
db[1].first = 1969;
db[1].second = "SpaceOddity";
db[2].first = 1970;
db[2].second = "TheManWhoSoldTheWorld";
db[3].first = 1971;
db[3].second = "HunkyDory";
db[4].first = 1972;
db[4].second = "TheRiseAndFallOfZiggyStardustAndTheSpidersFromMars";
db[5].first = 1973;
db[5].second = "AladdinSane";
db[6].first = 1973;
db[6].second = "PinUps";
db[7].first = 1974;
db[7].second = "DiamondDogs";
db[8].first = 1975;
db[8].second = "YoungAmericans";
db[9].first = 1976;
db[9].second = "StationToStation";
db[10].first = 1977;
db[10].second = "Low";
db[11].first = 1977;
db[11].second = "Heroes";
db[12].first = 1979;
db[12].second = "Lodger";
db[13].first = 1980;
db[13].second = "ScaryMonstersAndSuperCreeps";
db[14].first = 1983;
db[14].second = "LetsDance";
db[15].first = 1984;
db[15].second = "Tonight";
db[16].first = 1987;
db[16].second = "NeverLetMeDown";
db[17].first = 1993;
db[17].second = "BlackTieWhiteNoise";
db[18].first = 1995;
db[18].second = "1.Outside";
db[19].first = 1997;
db[19].second = "Earthling";
db[20].first = 1999;
db[20].second = "Hours";
db[21].first = 2002;
db[21].second = "Heathen";
db[22].first = 2003;
db[22].second = "Reality";
db[23].first = 2013;
db[23].second = "TheNextDay";
db[24].first = 2016;
db[24].second = "BlackStar";
for (scanf("%d", &t); t--; count = 0)
{
scanf("%d %d", &x, &y);
for (int i = 0; i < 25; ++i)
if (x <= db[i].first && db[i].first <= y)
++count;
cout << count << endl;
for (int i = 0; i < 25; ++i)
if (x <= db[i].first && db[i].first <= y)
cout << db[i].first << ' ' << db[i].second << endl;
}
}
'백준 > 백준-C++' 카테고리의 다른 글
1780번: 종이의 개수 (0) | 2017.06.01 |
---|---|
2003번: 수들의 합 [재채점 틀림] (0) | 2017.05.29 |
12790번: Mini Fantasy War (0) | 2017.05.29 |
1977번: 완전제곱수 (0) | 2017.05.28 |
1547번: 공 (0) | 2017.05.28 |