I write this :
   
  #include <stdio.h>
#include <stdlib.h>
#include<string.h>
   
  int main()
{
 char string1[101];
 char string2[101];
 int number1[101]={0};
 int number2[101]={0};
 char variable1;
 char variable2;
 int counter1;
 int counter2;
 int length1,length2;
   
   printf("enter a number: ");
 scanf("%s",string1);
 printf("enter a number: ");
 scanf("%s",string2);
   
   length1 = strlen(string1);
 length2 = strlen(string2);
   
   for (counter1 = 0;counter1 <= length1-1;counter1++){
  variable1 = string1[counter1];
  number1[counter1] = atoi(&variable1);
  printf("%d",number1[counter1]);
 }
 printf("\n");
  
 for (counter2 = 0;counter2 <= length2-1;counter2++){
  variable2 = string2[counter2];
  number2[counter2] = atoi(&variable2);
  printf("%d",number2[counter2]);
 }
 printf("\n");
   
   return 0;
  }

  ----------------------
  I entered 111 and 222, then the out put is 111 and 212121. But if I delete 
one of the two "for", it work on. Only when this two "for" get together, it 
will be wrong.
  I don't know why
   

       
---------------------------------
雅虎邮箱,终生伙伴! 

[Non-text portions of this message have been removed]

Reply via email to