Advertisement
MargaritaOwl

Guess a Number

May 14th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include<cstdlib>
  2. #include<iostream>
  3.  
  4. using namespace std;
  5.  
  6. void main()
  7. {
  8.     setlocale(LC_ALL,"rus");
  9.     float a;
  10.     cout<<"Загадайте любое число, а я попробую его отгадать"<<endl;
  11.     cout<<"Загадали?"<<endl;
  12.     cout<<"А теперь предлагаю вам выполнить несколько нехитрых операций с Вашим числом"<<endl;
  13.     cout<<"1)Умножьте ваше число на 10"<<endl;
  14.     cout<<"2)Прибавьте 2"<<endl;
  15.     cout<<"3)Поделите на 2"<<endl;
  16.     cout<<"Введите полученный результат"<<endl;
  17.     cin>>a;
  18.     cout<<"Ты загадал число "<<(a*2-2)/10<<"!"<<endl;
  19.     system("pause");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement