العودة إلى موقع برمج

تحويل الكود الى لغة c++

#1

#include<stdio.h>
#include<stdlib.h>
int Somme(int a,int b)
{
int s;
s=a+b;
return s;
}
int main()
{
int Somme(int,int);
int a,b,som;
printf(“donnez deux entiers\n”);
scanf("%d%d",&a,&b);
som=Somme(a,b);
printf("%d + %d = %d\n",a,b,som);
system(“pause”);
return 0;
}

  1. قائمة العناصر
#2

يمكنك ايجاد كود c++ التالي:

#include <iostream>
#include<stdio.h>
#include<stdlib.h>

int Somme(int a,int b)
{
int s;
s=a+b;
return s;
}
int main()
{
// int Somme(int,int);
int a,b,som;
printf("donnez deux entiers\n");
scanf("%d%d",&a,&b);
som=Somme(a,b);
printf("%d + %d = %d\n",a,b,som);

return 0;
}
#3

شكرا على الرد لكنك لم تفهم سؤالي هذا الكود في البرمجة c و أنا أحتاجه في البرمجة c ++

#4

هذا الكود الذي وضعته لك سيعمل الان في بيئة C++

#5

#include

using namespace std;

float sum;
void menu(){

cout<<“1-account balance”<<endl; //ßÔÝ ÇáÍÓÇÈ
cout<<"2-Add money "<<endl; //ÇÖÇÝÉ ãÇá
cout<<“3-Withdraw balance”<<endl; //ÓÍÈ ÇáÑÕíÏ
cout<<“4-your infotmation”<<endl;//ãÚáæãÇÊß
cout<<“5- EXIT”<<endl;

}

bool login(string u="",string p=""){
string username=“wael”;
string password=“12345”;
if(u==username&&p==password)
{return true;}
else
return false;

}

int main()
{

string u,p;int i=0;
while( i<5000){
cout<<“please enter username”<<endl;
cin>>u;
cout<<“plese enter password”<<endl;
cin>>p;
if(login(u,p)==true){
int c;
float b=5000;
cout<<endl;
cout<<“welcom:”<<u<<endl;
while(c!=-1){
menu();
cout<<“choice :”;
cin>>c;

switch(c){

case 1:
cout<<"your balance : "<<b<<endl;
break;
case 2:
float addM;

cout<<"how much add money"<<endl;
cin>>addM;
 sum=b+addM;

b=sum;
cout<<"your money "<<sum<<endl;

break;
case 3:
     float witM;

cout<<"how much add money"<<endl;
cin>>witM;
if(witM>b)
{
    cout<<"This process can not be completed because the balance is less than the value entered"<<endl;
}
else{
 sum=b-witM;
 b=sum;
 cout<<"done Withdraw money your balance :"<<b<<endl;
 }
break;
case 4:
    cout<<"your name is wael  "<<endl;
    cout<<"number of card "<<"952555422"<<endl;
    cout<<"phone "<<"059525555"<<endl;

break;
case 5:
   c=-1 ;
   i++;
   cout<<"good bye"<<endl;
break;
default:

cout<<"Just from 1 - 5 can choice or exit press 5 "<<endl;
i++;
break;

}

}

}
else
cout<<“login fild”<<endl;}

return 0;

}