Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program: isbn.cc
- // Author: Yoan Pinzon
- // Date: Agosto 30, 2006
- #include <iostream>
- using namespace std;
- int main()
- {
- int d1, d2, d3, d4, d5, d6, d7, d8, d9, d10;
- cout << "Digito de control ISBN" << endl;
- cout << "======================" << endl;
- cout << "Introduzca el ISBN = ";
- cin >> d1 >> d2 >> d3 >> d4 >> d5 >> d6 >> d7 >> d8 >> d9;
- d10= 1*d1 + 2*d2 + 3*d3 + 4*d4 + 5*d5 + 6*d6 + 7*d7 + 8*d8 + 9*d9;
- d10 %= 11;
- if( d10==10 )
- {
- cout << "El digito de control es X" << endl;
- }
- else
- {
- cout << "El digito de control es " << d10 << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement