Advertisement
Guest User

ISBN

a guest
Oct 21st, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int n,a[100];
  5.     scanf("%d",&n);
  6.     for(int i=1;i<=9;i++)
  7.     {
  8.   a[i]=n%10;
  9.   n=n/10;
  10.     }
  11.     int sum=0;
  12.     for(int i=10;i>=2;i--)
  13.    
  14.     {
  15. sum+=a[i-1]*i;
  16. }
  17. int m;
  18. for(int i=0;sum%11!=0;i++){
  19.     m=i;
  20.     sum = sum +i;
  21.  
  22.  
  23. }
  24.  
  25. printf("%d-%d%d%d-%d%d%d%d%d-%d",a[9],a[8],a[7],a[6],a[5],a[4],a[3],a[2],a[1],m);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement