Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int num;
- int dividorForVersion = 100000000, dividorForSpec=1000000;
- cout << "Input integer with 9 digits:";
- cin >> num;
- cout << "The vesion of the card is:" << num / dividorForVersion;
- num %= dividorForVersion;
- num %= 10;//Because the second digit of the num is useless
- switch (num / dividorForSpec)
- {
- case 0:cout << "Informatics"; break;
- case 1:cout << "Computer science"; break;
- case 2:cout << "Information systems"; break;
- case 3:cout << "Softwere engineering"; break;
- case 4:cout << "Applied Mathematics"; break;
- case 5:cout << "Mathematics"; break;
- case 6:cout << "Statistics"; break;
- case 8:cout << "Mathematics and informatics"; break;
- default:cout << "Invalid card number"; break;
- }
- num %= 10;
- num /= 10;
- if (num != 0)
- {
- cout << "Owner ID is:" << num;
- }
- else
- {
- cout << "Invalid card number";
- }
- while (true) {};
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement