|
|
第1行: |
第1行: |
| == Open source program ==
| | {{删|剽窃行为: 查重率100%}} |
| This program takes Chat Alphabet letters as input. [[User:ColorfulGalaxy|ColorfulGalaxy]]([[User talk:ColorfulGalaxy|留言]]) 2024年12月16日 (一) 20:00 (CST)
| |
| <pre>#include <cstdio>
| |
| #define lnt long long
| |
| const char format[]="%lld";
| |
| unsigned char c;
| |
| lnt sum;
| |
| const lnt nums[256]={
| |
| 00000,00000,00000,00000, 00000,00000,00000,00000, 00000,00000,00000,00000, 00000,00000,00000,00000,
| |
| 00000,00000,00000,00000, 00000,00000,00000,00000, 00000,00000,00000,00000, 00000,00000,00000,00000,
| |
| 00000,00+00,00000,00000, 00000,00000,00000,00000, 00000,00000,00000,00000, 00000,00000,00000,00000,
| |
| 00000,80000,30000,60000, 0+400,0+500,20000,0+800, 50000,00000,00000,00000,
| |
| 00000,00000,00000,00000,
| |
| 00000,+8000,0+900,00000, 00+20,+7000,0+700,00000, 00+50,00000,00000,00000, 10000,00000,00+60,00000,
| |
| 00000,00000,00000,00000, 40000,00000,70000,00000, 00000,+9000,00000,00000, 00000,00000,00000,00000,
| |
| 00000,+4000,00001,+1000, 00+80,+6000,+2000,0+100, 0+300,90000,00005,0+200, 00+70,00003,000+9,+5000,
| |
| 00002,00006,00+40,00+30, 00+90,+3000,0+600,00004, 00007,000+8,00+10};
| |
| int main(){
| |
| while((c=getchar())-255){
| |
| sum+=nums[c];
| |
| sum<0 && fputs("Number overflow",stderr);
| |
| } | |
| printf(format,sum);
| |
| return 0;
| |
| }</pre> | |