Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char ** argv)
  5. {
  6.     int n[4] = {50, 10, 5, 1}, resul[4];
  7.     int i, valor1, valor2 = 0;
  8.     while( scanf("%i", &valor) )
  9.     {
  10.         if(valor == 0)
  11.         {  
  12.             return 0;
  13.         }
  14.         valor2++;
  15.         for(i = 0; i < 4; i++) {
  16.             resul[i] = valor1 / n[i];
  17.             valor1 = valor1 % n[i];
  18.         }
  19.         printf("Teste %i\n%i %i %i %i\n\n", valores, resul[0], resul[1], resul[2], resul[3]);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement