Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by minoru ( 17 years ago )
#include <iostream>
#include <cstring>

using namespace std;

int main() {
    string number;
    int result;
    
    cin >> number;
    
    result=0;
//    cout << "result = " << result << endl;
    for(int i=0; i < number.length(); i++){
        result=(result * 10 + number[i] - '0') % 7;
//        cout << "result = " << result << endl;
    }
    cout /*<< "&ETH;&nbsp;&ETH;&micro;&ETH;&middot;&Ntilde;ƒ&ETH;&raquo;&Ntilde;Œ&Ntilde;‚&ETH;&deg;&Ntilde;‚: "*/ << result << endl;

    return 0;
}

 

Revise this Paste

Your Name: Code Language: