Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <stdio.h>
- using namespace std;
- int main()
- {
- int pesel[11];
- int suma = 0, n=0;
- //cin >> n;
- //for (int o = 0; o < n; o++){
- for (int i = 0; i < 11; i++)
- pesel[i] = getchar() - 48;
- pesel[0] *= 1;
- pesel[1] *= 3;
- pesel[2] *= 7;
- pesel[3] *= 9;
- pesel[4] *= 1;
- pesel[5] *= 3;
- pesel[6] *= 7;
- pesel[7] *= 9;
- pesel[8] *= 1;
- pesel[9] *= 3;
- pesel[10] *= 1;
- for (int i = 0; i < 11; i++)
- suma += pesel[i];
- if (suma > 0)
- if ((suma % 10) == 0)
- cout << "D" << endl;
- else
- cout << "N" << endl;
- else
- cout << "N" << endl;
- suma = 0;
- //}
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment