Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int n;
- string str;
- int temp;
- int i = 0;
- do
- {
- str ="";
- cin >> n;
- if ( n == 0 )
- return 0;
- n = 3 * n;
- //****n2***
- if ( n % 2 == 0 )
- {
- str = "even";
- temp = n/2;
- }
- else
- {
- str = "odd";
- temp = (n+1 )/2;
- }
- //****n3********
- temp = 3 * temp;
- //*****n4*******
- temp = temp /9;
- i++;
- cout << i << ". " << str <<" " << temp << endl;
- }
- while ( n != 0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement