Advertisement
Kl43z

numeros rom

Oct 7th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main{
  4. int input,dig1,dig2,dig3,dig4;
  5. char i='i', v='v', x='x', l='l', c='c', d='d', m='m';
  6. printf ("Ingrese un número enter entre 1 y 3500:\n");
  7. scanf ("%d", &input);
  8. pdig1=input/1000; //3
  9. dig1=pdig1*1000; // 3000
  10. pdig2=(input-dig1)/100; //5
  11. dig2=pdig2*100; //500
  12. pdig3=((input-dig1)-dig2)/10; //2
  13. dig3=pdig3*10; //20
  14. dig4=((input-dig1)-dig2)-dig3; //3
  15. //probcen
  16. if (pdig2<=3 && pdig2>=1){
  17. caso=1;
  18. }
  19. else if (pdig2==4){
  20. caso=2
  21. }
  22. else if (pdig2==5){
  23. caso=3;
  24. }
  25. else if (pdig2>5 && pdig<9){
  26. caso=4;
  27. }
  28. switch (caso){
  29. case 1:
  30. for (i=1;i=pdig2;i++){
  31. printf ("%c", c);
  32. }
  33. break;
  34. case 2:
  35. printf("%c%c",c,d);
  36. break;
  37. case 3:
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement