#7651: 為什麼一直都是RE?高手請救救我


cuh127 (futurhack~~~~~興國猩國也(絕對沒有在污辱女性))


#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void pt(int a)
{char word[19][5]={"零","壹","貳","參","肆","伍","陸","柒","捌","玖"} ;
  if(a/1000>0){
  printf("%s仟",word[a/1000]);
  }
 if(a/100>0){
  printf("%s佰",word[a/100]);
  }
  if(a/10>0){
  printf("%s拾",word[a/10]);
  }
  if(a>0){
  printf("%s",word[a]);
  } 
}

int main(int argc, char *argv[]) {
int b,c=0;

while(c!=1)
{   scanf("%d",&b);
    if(b>=0&&b<=2147483647) {
if(b/100000000>0)
{pt(b/100000000>0);
printf("億");
}
if(b/10000>0){
pt(b/10000);
printf("萬");
}
if (b/10000>0 && b/1000%10==0 && b%1000>0){
printf("零");
}
pt(b%10000);
if(b==0){
printf("零");
}
printf("\n");
}
else
c=c+1;
}
return 0;
}
#7655: Re:為什麼一直都是RE?高手請救救我


cuh127 (futurhack~~~~~興國猩國也(絕對沒有在污辱女性))


#include
#include

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void pt(int a)
{char word[19][5]={"零","壹","貳","參","肆","伍","陸","柒","捌","玖"} ;
  if(a/1000>0){
  printf("%s仟",word[a/1000]);
  }
 if(a/100>0){
  printf("%s佰",word[a/100]);
  }
  if(a/10>0){
  printf("%s拾",word[a/10]);
  }
  if(a>0){
  printf("%s",word[a]);
  } 
}

int main(int argc, char *argv[]) {
int b,c=0;

while(c!=1)
{   scanf("%d",&b);
    if(b>=0&&b<=2147483647) {
if(b/100000000>0)
{pt(b/100000000>0);
printf("億");
}
if(b/10000>0){
pt(b/10000);
printf("萬");
}
if (b/10000>0 && b/1000%10==0 && b%1000>0){
printf("零");
}
pt(b%10000);
if(b==0){
printf("零");
}
printf("\n");
}
else
c=c+1;
}
return 0;
}
 
原來用 char*[10]就可以了