#include <iostream> using namespace std; int main() { setlocale(0,""); int a; cout<<"введите значение погоды"<<endl; cout<<"1-тепло"<<endl; cout<<"2-жарко"<<endl; cout<<"3-холодно"<<endl; cout<<"4-колотун"<<endl; cin>>a; switch (a) { case 1: cout<<"вы можете одеть джинсы и футболку"<<endl; break; case 2: cout<<"вы можете одеть шорты и майку "<<endl; break; case 3: cout<<"вы можете одеть штаны и толстовку "<<endl; break; case 4: cout<<"вы можете одеть куртку и свитер с подштанниками и ватными штанми "<<endl; break; } return 0; }
#include <iostream>#include <cstdlib>#include <ctime> using namespace std; int main(){ srand(static_cast<unsigned int>(time(0))); //seed random number generator int secretNumber = rand() % 100 + 1; // random number between 1 and 100 int tries = 0; int guess; cout << "\tWelcome to Guess My Number\n\n"; do { cout << "Enter a guess: "; cin >> guess; ++tries; if (guess > secretNumber) { cout << "Too high!\n\n"; } else if (guess < secretNumber) { cout << "Too low!\n\n"; } else { cout << "\nThat's it! You got it in " << tries << " guesses!\n"; } } while (guess != secretNumber); return 0;}
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota
Оформи подписку