This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// находит позицию собачки | |
int findAtPosition(std::string email) { | |
for (int i = 0; i < email.length(); i++) { | |
if (email[i] == '@') { | |
return i; | |
} | |
} | |
return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
bool isLow (char x) { | |
if (x >= 'a' && x <= 'z') { | |
return true; | |
} | |
return false; | |
} | |
bool isHigh (char x) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
int main() | |
{ | |
float a, b, c; | |
std::cout << "a, b, c:"; | |
std::cin >> a >> b >> c; | |
if (a < 0) | |
{ | |
std::cout << "Not a quadratic equation!" << std::endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Разбить десятичное число на разряды: тысячи, сотни, десятки, единицы. Римские числа 4 и 9 пишутся в другом порядке, поэтому их обработку нужно вынести в отдельные условия. */ | |
#include <iostream> | |
#include <string> | |
int main() { | |
int number; | |
std::cin >> number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
int main () { | |
std::string str; | |
std::cout << "Input string: "; | |
std::getline(std::cin, str); | |
int wordCounter = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main () { | |
std::string number; | |
std::cout << "Input number: "; | |
std::cin >> number; | |
bool isDigit; | |
if ((number[0] <= '9' && number[0] >= '0') || number[0] == '.' || number[0] == '-') { | |
isDigit = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main () { | |
std::string departureTime; | |
std::cout << "Input departure time: "; | |
std::cin >> departureTime; | |
int departureHours = (departureTime[0] - '0')*10 + (departureTime[1] - '0'); | |
int departureMinutes = (departureTime[3] - '0')*10 + (departureTime[4] - '0'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
int main () { | |
float amplitude; | |
int counter = 0; | |
std::cout << "Начальная амплитуда, см: "; | |
std::cin >> amplitude; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
int main () { | |
float distance, seconds, temp = 0; | |
std::cout << "Привет, Сэм! Сколько километров ты сегодня пробежал? "; | |
std::cin >> distance; | |
for (int i = 1; i <= distance; i++) { | |
std::cout << "Какой у тебя был темп на километре " << i << "?\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
int main () { | |
float size, speed, downloaded; | |
std::cout << "Укажите размер файла: "; | |
std::cin >> size; | |
std::cout << "Укажите скорость: "; | |
std::cin >> speed; |
NewerOlder