Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. int main(){
  5. int tab [1000];
  6. int x;
  7. int k = 0;
  8.  
  9.  
  10. printf("Podaj liczbe:\n");
  11.  
  12. while(scanf("%i" ,&x)==1){
  13. tab[k]=x;
  14. if( x < 0){
  15. printf(" Podaj liczbe nieujemną!\n");
  16. return 1;
  17. }
  18.  
  19. int i,dziesiatki,jednosci;
  20. for ( i=1; i<x;i++)
  21.  
  22. tab[k]=tab[k]*i;
  23.  
  24.  
  25.  
  26. dziesiatki = tab[k]/10 - ((tab[k]/100)*10);
  27. jednosci= tab[k]-((tab[k]/10)*10);
  28.  
  29. printf("%d %d\n" , dziesiatki , jednosci);
  30. k++;
  31. }
  32.  
  33. return 0;
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement