Jump to content

Recommended Posts

Posted
#include <iostream> int main()
{
     int a, b;
     std::cout<<"Scrie a=";
     std::cin>>a;
     std::cout<<"Scrie b=";
     std::cin>>b;
     std::cout<<a<<"+"<<b<<"="<<a+b;
     return 0;
}

fWy1P.gif

 

Posted

Am zis eu ca era problema intre scaun si tastatura de la inceput. :)

Mai intreb o data: cum sa-ti detecteze sistemul virus intr-un program care inca nu exista ?

 

In poza se vede o greseala grosolana: int main(); {}

 

Si incearca sa scrii mai structurat. Nu folosi directive de preprocesor si functii pe aceeasi linie.

Foloseste-te de namespace-uri:

 

#include <iostream>
int main() {
    using namespace std;
    int a, b;
    cout<<"Scrie a=";
    cin>>a;
    cout<<"Scrie b=";
    cin>>b;
    cout<<a<<"+"<<b<<"="<<a+b;
    cin.get();
    return 0;
}

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.