Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int podzielnosc13 (string liczba)
- {
- int suma=0;
- int n=liczba.size();
- int r[]={1,10,9,12,3,4};
- for(int i=n-1;i>=0;i--)
- {
- suma+=(liczba[i]-'0')*r[(6-((i+1)%6))];
- }
- return suma%13;
- }
- int main()
- {
- cout<<podzielnosc13("1300000000000000000000000000000000000000012");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement