Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include "stdafx.h"
- #include <iostream>
- #include <cstring>
- #define SIZE 101
- //#define _CRT_SECURE_NO_WARNINGS
- using namespace std;
- char outchar(int in_number)
- {
- char *outWord = new char [SIZE];
- int snumber = in_number % 10;
- switch (snumber)
- {
- case 1:
- {
- if (in_number % 100 == 11)
- {
- strcpy(outWord, "ñòîëîâ");
- }
- else
- strcpy(outWord, "ñòîë");
- }
- break;
- case 2:
- case 3:
- case 4:
- {
- if ((in_number % 100 >= 12) && (in_number % 100 <= 14))
- {
- strcpy(outWord, "ñòîëîâ");
- }
- else
- strcpy(outWord, "ñòîëà");
- }
- default:
- {
- if ((in_number % 10 >= 5) && (in_number % 100 <= 20))
- strcpy(outWord, "ñòîëîâ");
- }
- }
- cout << "outWord = " << outWord <<endl;
- cout << "wordt = " << wordt <<endl;
- char wordt [10];
- strcpy(wordt, outWord);
- return wordt[10];
- delete [] outWord;
- }
- int main()
- {
- int number = 0;
- setlocale(0, "");
- cout << "Ââåäèòå ÷èñëî\n";
- cin >> number;
- cout << number << " " << outchar(number) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement