SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. int digito2(int a){
  3.     int  s,a1,a2,a3,a4,a5,a6,a7,a8,a9,d1,d2;
  4.     a1=a*11;
  5.     a2=a*10;
  6.     a3=a*9;
  7.     a4=a*8;
  8.     a5=a*7;
  9.     a6=a*6;
  10.     a7=a*5;
  11.     a8=a*4;
  12.     a9=a*3;
  13.  
  14.     s=a1+a2+a3+a4+a5+a6+a7+a8+a9;
  15.     if (s%11<2){
  16.         return 0;
  17.     } else{
  18.  
  19.         return (11-(s%11));
  20.     }
  21. }
  22. int main() {
  23.     int a1,a2,a3,a4,a5,a6,a7,a8,a9,d1,d1l,d2,d2l,s;
  24.  
  25.     scanf("%d",&a1);
  26.     scanf("%d",&a2);
  27.     scanf("%d",&a3);
  28.     scanf("%d",&a4);
  29.     scanf("%d",&a5);
  30.     scanf("%d",&a6);
  31.     scanf("%d",&a7);
  32.     scanf("%d",&a8);
  33.     scanf("%d",&a9);
  34.     scanf("%d",&d1l);
  35.     scanf("%d",&d2l);
  36.  
  37.     digito2(a1);
  38.     digito2(a2);
  39.     digito2(a3);
  40.     digito2(a4);
  41.     digito2(a5);
  42.     digito2(a6);
  43.     digito2(a7);
  44.     digito2(a8);
  45.     digito2(a9);
  46.  
  47.     a1=a1*10;
  48.     a2=a2*9;
  49.     a3=a3*8;
  50.     a4=a4*7;
  51.     a5=a5*6;
  52.     a6=a6*5;
  53.     a7=a7*4;
  54.     a8=a8*3;
  55.     a9=a9*2;
  56.  
  57.     s=a1+a2+a3+a4+a5+a6+a7+a8+a9;
  58.  
  59.     if (s%11<=2){
  60.  
  61.         d1=0;
  62.  
  63.     }else{
  64.         d1=11-(s%11);
  65.  
  66.     }
  67.  
  68. printf("%d %d %d %d %d %d %d %d %d %d %d",a1,a2,a3,a4,a5,a6,a7,a8,a8,d1,digito2);
  69.     return 0;
  70. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top