کدهای قبل از main رو به اینی که پایین گزاشتم تغییر بده، موقع ساخت پروژه هم گزینه Empty project رو بزن
من با همین تغییران کامپایل کردمکد:#include <iostream>
#include <conio.h>
#include <iomanip>
using namespace std;
Printable View
کدهای قبل از main رو به اینی که پایین گزاشتم تغییر بده، موقع ساخت پروژه هم گزینه Empty project رو بزن
من با همین تغییران کامپایل کردمکد:#include <iostream>
#include <conio.h>
#include <iomanip>
using namespace std;
باز هم حل نشد :41:
خب مشکلتون چیه ؟ شما که نگفتین منظورتون از تبدیل ++Turbo C به ++C چی هست ؟ تو برنامه نویسی یه همچین جمله ای مفهوم نداره .
من فقط 1 چیز میخوام
این کدی که دادم رو بتونم توی c++ اجرا کنم
این کارهایی هم که تا الان کفتید رو انجام دادم ولی برنامه اشکال داره
یعنی 1 نفر نیست این کد رو دوباره بنویسه و برام بذاره ؟!
ممنون
ای بابا . باز میگه به ++C تبدیل کن . بفرما . این کد رو امتحان کن :
کد:#include <iostream>
#include <conio.h>
#include <iomanip>
//#include <vcl>
using namespace std;
int main(){
int i,j,k,s,p;
char input='\0';
int cost[13],incom[12],netincom[12],tcost=0,tincom=0,tnetincom=0;
int costmax=0,incommax=0,netincommax;
int year=0,mounth=0,day=0;
cout<<"Enter Command"<<'\n';
for(i=1;i<=12;i++){
cost[i]=0;
netincom[i]=0;
incom[i]=0;
}
while(input!='*'){
cout<<"Cost-Exit-Incom-Maximum(C/E/I/M)"<<'\n';
cin>>input;
if (input=='c'){
cout<<"total cost is "<<tcost<<"\n";
cout<<"insert new cost"<<'\n';
cout<<"insert date"<<'\n';
cout<<"day= ";
cin>>day;
cout<<"mounth=";
cin>>mounth;
cout<<"year=";
cin>>year;
cout<<"cost=";
cin>>cost[mounth];
tcost=tcost+cost[mounth];
tnetincom=tnetincom-cost[mounth];
netincom[mounth]=netincom[mounth]-cost[mounth];
cout<<'\n'<<'\n';
} //end if//
else if(input=='i'){
cout<<"total incom is "<<tincom<<'\n';;
cout<<"insert new incom"<<'\n';
cout<<"insert date"<<'\n';
cout<<"day= ";
cin>>day;
cout<<"mounth=";
cin>>mounth;
cout<<"year= ";
cin>>year;
cout<<"incom= ";
cin>>incom[mounth];
tincom=tincom+incom[mounth];
tnetincom=tnetincom+incom[mounth];
netincom[mounth]=netincom[mounth]+incom[mounth];
cout<<'\n'<<'\n';
} //end incom//
else if(input=='m'){
for(j=1;j<=12;j++){
if (cost[j]>costmax)
costmax=cost[j];
if (incom[j]>incommax)
incommax=incom[j];
if (netincom[j]>netincommax)
netincommax=netincom[j];
} //end for//
cout<<"netincommax= "<<netincommax<<'\n';
cout<<"incommax= "<<incommax<<'\n';
cout<<"costmax= "<<costmax<<'\n';
cout<<'\n';
} //end if//
else if(input=='e'){
cout<<" "<<"YERLY REPORT"<<'\n';
cout<<"Month Incom Cost Netincome"<<'\n';
cout<<"--------------------------------------------------------------------"<<'\n';
for(k=1;k<=12;k++)
cout<<setw(2)<<k<<" "<<incom[k]<<" "<<cost[k]<<" "<<netincom[k]<<'\n';
cout<<"--------------------------------------------------------------------"<<'\n';
cout<<"Total"<<" "<<tincom<<" "<<tcost<<" "<<tnetincom<<'\n'<<'\n';
break ;
}//end if//
else if(input!='c'||input!='e'||input!='i'||input!='m')
cout<<"the charechter is not avalable pleas try again"<<'\n'<<'\n';
if (cost[1]+cost[2]+cost[3]>10000000){
cout<<"hazine bahar bishtar az hade mojaz ast"<<'\n';
cost[1]=cost[2]=cost[3]=0;
}
if (cost[4]+cost[5]+cost[6]>10000000){
cost[4]=cost[5]=cost[6]=0;
cout<<"hazine tabestan bishtar az hade mojaz ast"<<'\n' ;
}
if (cost[7]+cost[8]+cost[9]>10000000){
cost[7]=cost[8]=cost[9]=0;
cout<<"hazine paeez bishtar az hade mojaz ast"<<'\n' ;
}
if (cost[10]+cost[11]+cost[12]>10000000){
cost[10]=cost[11]=cost[12]=0;
cout<<"hazine zemestan bishtar az hade mojaz ast"<<'\n';
}
if (incom[1]+incom[2]+incom[3]>100000000){
cout<<"daramad bahar bishtar az hade mojaz ast"<<'\n';
cost[1]=cost[2]=cost[3]=0;
}
if (incom[4]+incom[5]+incom[6]>100000000){
incom[4]=incom[5]=incom[6]=0;
cout<<"daramad tabestan bishtar az hade mojaz ast"<<'\n' ;
}
if (incom[7]+incom[8]+incom[9]>100000000) {
cost[7]=cost[8]=cost[9]=0;
cout<<"daramad paeez bishtar az hade mojaz ast"<<'\n' ;
}
if (incom[10]+incom[11]+incom[12]>100000000){
incom[10]=incom[11]=incom[12]=0;
cout<<"daramad zemestan bishtar az hade mojaz ast"<<'\n';
}
} //end while//
getch();
return 0;
} //end main