Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int num;
  6. int dividorForVersion = 100000000, dividorForSpec=1000000;
  7. cout << "Input integer with 9 digits:";
  8. cin >> num;
  9. cout << "The vesion of the card is:" << num / dividorForVersion;
  10. num %= dividorForVersion;
  11. num %= 10;//Because the second digit of the num is useless
  12. switch (num / dividorForSpec)
  13. {
  14. case 0:cout << "Informatics"; break;
  15. case 1:cout << "Computer science"; break;
  16. case 2:cout << "Information systems"; break;
  17. case 3:cout << "Softwere engineering"; break;
  18. case 4:cout << "Applied Mathematics"; break;
  19. case 5:cout << "Mathematics"; break;
  20. case 6:cout << "Statistics"; break;
  21. case 8:cout << "Mathematics and informatics"; break;
  22. default:cout << "Invalid card number"; break;
  23. }
  24. num %= 10;
  25. num /= 10;
  26. if (num != 0)
  27. {
  28. cout << "Owner ID is:" << num;
  29. }
  30. else
  31. {
  32. cout << "Invalid card number";
  33. }
  34. while (true) {};
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement