Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  123
Language: C/C++
Code:
#include <stdio.h>
#include <iostream>
using namespace std;

int main()
{
     double osnova=1000;
     double twink=6600;
     double sell=150;
     double buy=100;
     int op=0;
     for(;;){
   cout<<"sell: "<<endl;
     cin>>sell;
     if(sell==0)break;
     cout<<"buy: "<<endl;
     cin>>buy;
     twink-=sell;
     while(twink-sell>=0){
          osnova-=buy;
          twink=twink+(buy/100*90);
          twink-=sell;     
          osnova=osnova+(sell/100*90);
          op++;
     }
     cout<<"ballance :"<<endl<<"osnowa:  "<<osnova<<endl<<"twink: "<<twink<<" + detail"<<endl;
     cout<<"market operation: "<<op<<endl;
     osnova=500;
     twink=600;
     op=0;
     }
}
Comments: