Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main(int argc, char** argv) {
- system(" chcp 1251 > nul");
- bool flag; //óñëîâèå ìíîãîêðàòíîé ðàáîòû ïðîãðàììû
- string otvet; //îáúÿâëåíèå ïåðåìåííûõ
- int i;
- float a, s;
- do
- {
- s=1;
- cin>>a;
- if(a>=0)
- {
- for(i=2; i<=8; i+=2)
- {
- s*=i*i;
- }
- s-=a;
- }
- else
- {
- for(i=3; i<=9; i+=3)
- {
- s*=(i-2);
- }
- }
- cout << setprecision(9) << s << '\n';
- cout<<"Ïðîäîëæèòü ðàáîòó? (y,n)"; //ìíîãîêðàòíàÿ ðàáîòà
- cin>>otvet;
- if(otvet=="y")
- {
- flag=true;
- }
- if(otvet=="n")
- {
- flag=false;
- }
- cout<<endl;
- }
- while(flag);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement