Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- system("chcp 1251>nul");
- cout << "Таблица цены сыра:" << endl << " ________________" << endl << "|цена |стоимость|"
- << endl << "|______|_________|" << endl;
- int weight = 50, price = 280, price1;
- for (weight; weight <= 1000; weight += 50)
- {
- price1 = weight * price / 1000;
- cout << "|" << weight<<"г";
- if (weight < 100)
- cout << " |" << price1 << "р |" << endl;
- else
- if (weight < 400)
- cout << " |" << price1 << "р |" << endl;
- else
- if (weight < 1000)
- cout << " |" << price1 << "р |" << endl;
- else
- cout << " |" << price1 << "р |" << endl;
- cout << "|______|_________|" << endl;
- }
- system("pause>nul ");
- return 0;
- }
Add Comment
Please, Sign In to add comment