Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int t, s;
- char pesel[12];
- cin>>t;
- while(t--)
- {
- cin>> pesel;
- s =
- (1 * pesel[0]) +
- (3 * pesel[1]) +
- (7 * pesel[2] )+
- (9 * pesel[3]) +
- (1 * pesel[4]) +
- (3 * pesel[5]) +
- (7 * pesel[6]) +
- (9 * pesel[7]) +
- (1 * pesel[8]) +
- (3 * pesel[9]) +
- (1 * pesel[10])
- ;
- if (s%10 == 0)
- {
- cout << "D" << endl;
- }
- else
- {
- cout << "N" << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement