版本比较
P1617题解
正文
增加 7 行删除 7 行
41 行未改动4243444546474849504 行未改动555657585960616263646530 行未改动969798991001011021031041054 行未改动1101111121131141151161171183 行未改动1221231241251261271281291303 行未改动41 行未改动case 5:cout<<"five ";break;case 6:cout<<"six ";break;case 7:cout<<"seven ";break;case 8:cout<<"eight ";break;case 9:cout<<"nine ";break;}if(a) cout<<"thousand ";switch(b){4 行未改动case 5:cout<<"five ";break;case 6:cout<<"six ";break;case 7:cout<<"seven ";break;case 8:cout<<"eight ";break;case 9:cout<<"nine ";break;}if(b==0&&n%100>0&&n>=100) cout<<"and ";if(b) cout<<"hundred ";n=n%100;if(n%10==0||n/10==1){30 行未改动case 5:cout<<"five ";break;case 6:cout<<"six ";break;case 7:cout<<"seven ";break;case 8:cout<<"eight ";break;case 9:cout<<"nine ";break;}}else{switch(c)4 行未改动case 5:cout<<"fifty ";break;case 6:cout<<"sixty ";break;case 7:cout<<"seventy ";break;case 8:cout<<"eighty ";break;case 9:cout<<"ninety ";break;}switch(d){case 1:cout<<"one";break;3 行未改动case 5:cout<<"five";break;case 6:cout<<"six";break;case 7:cout<<"seven";break;case 8:cout<<"eight";break;case 9:cout<<"nine";break;}}}}3 行未改动41 行未改动4243444546474849504 行未改动555657585960616263646530 行未改动969798991001011021031041054 行未改动1101111121131141151161171183 行未改动1221231241251261271281291303 行未改动41 行未改动case 5:cout<<"five ";break;case 6:cout<<"six ";break;case 7:cout<<"seven ";break;case 8:cout<<"eight ";break;case 9:cout<<"nine ";break;}if(a) cout<<"thousand ";switch(b){4 行未改动case 5:cout<<"five ";break;case 6:cout<<"six ";break;case 7:cout<<"seven ";break;case 8:cout<<"eight ";break;case 9:cout<<"nine ";break;}if(b==0&&n%100>0&&n>=100) cout<<"and ";if(b) cout<<"hundred ";n=n%100;if(n%10==0||n/10==1){30 行未改动case 5:cout<<"five ";break;case 6:cout<<"six ";break;case 7:cout<<"seven ";break;case 8:cout<<"eight ";break;case 9:cout<<"nine ";break;}}else{switch(c)4 行未改动case 5:cout<<"fifty ";break;case 6:cout<<"sixty ";break;case 7:cout<<"seventy ";break;case 8:cout<<"eighty ";break;case 9:cout<<"ninety ";break;}switch(d){case 1:cout<<"one";break;3 行未改动case 5:cout<<"five";break;case 6:cout<<"six";break;case 7:cout<<"seven";break;case 8:cout<<"eight";break;case 9:cout<<"nine";break;}}}}3 行未改动