Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,d=0;
- char pesel[11];
- char wyn[100];
- int tab[11];
- int w[100];
- cin>>n;
- do
- {
- for (int i=0;i<11;i++)
- {
- cin.clear();
- cin>>pesel[i];
- }
- int g;
- int tab[11];
- tab[0]=pesel[0]*1;
- tab[1]=pesel[1]*3;
- tab[2]=pesel[2]*7;
- tab[3]=pesel[3]*9;
- tab[4]=pesel[4]*1;
- tab[5]=pesel[5]*3;
- tab[6]=pesel[6]*7;
- tab[7]=pesel[7]*9;
- tab[8]=pesel[8]*1;
- tab[9]=pesel[9]*3;
- tab[10]=pesel[10]*1;
- for (int b=0;b<11;b++)
- {
- g+=tab[b];
- }
- if (g%10==0)
- wyn[d]='D';
- else wyn[d]='N';
- d++;
- }
- while (d<n);
- for (int z=0;z<d;z++)
- cout<<wyn[z]<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement