#includeusing namespace std; int main() { int sum, peb[5], res[5], num, i, j; peb[1] = 25; peb[2] = 10; peb[3] = 5; peb[4] = 1; cin >> num; for (i = 1; i <= num; i++) { cin >> sum; cout << i << " "; for (j = 1; j <= 4; j++) { res[j] = sum / peb[j]; sum = sum % peb[j]; } cout << res[1] << " QUARTER(S), " << res[2] << " DIME(S), " << res[3] << " NICKEL(S), " << res[4] << " PENNY(S)" << endl; } return 0; }
아으....
컴 겨우 어떻게 살리긴 했는데 컴파일 한번 하고 죽음. -_-;
'Solutions > Dlbo's Solution' 카테고리의 다른 글
PKU 3176. Cow bowling. AC get -_- (0) | 2010.11.02 |
---|---|
PKU 2260. Error Correction. AC get -_- (3) | 2010.10.28 |
PKU 1422. Air Raid. AC get! (0) | 2010.06.24 |
PKU 1422. Air raid. WA -_-.... (2) | 2010.06.23 |
PKU 2844. Sum and Product. TLE -_- (1) | 2010.06.22 |