This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// citire cu stream-ul 'cin' | |
#include <iostream> | |
using namespace std; | |
char s[10], a[10]; | |
int main() | |
{ | |
// daca de la tastatura se introduce textul 'abc de fg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int a[4] = { 2,3,4,5 }, * p, i; | |
int main() | |
{ | |
// p va avea ca valoare adresa primului element al tabloului a | |
p = a; | |
// p va avea ca valoare adresa celui de-al treilea element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// suma a 2 numere in fisier | |
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
int main() | |
{ | |
int a, b; | |
// deschide fisierul pentru scriere: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// citire-afisare vector | |
// includere fisiere cu declaratii: | |
#include <iostream> | |
using namespace std; | |
// functia principala: | |
int main() | |
{ | |
// declarare variabile: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// maxim | |
// D.I.: a, b (numere reale) | |
// D.E.: max (numar real) | |
// includere fisiere cu declaratii: | |
#include <iostream> | |
using namespace std; | |
// functia principala: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hello, World! | |
#include <iostream> | |
int main() | |
{ | |
std::cout << "Hello, World!\n"; | |
} | |
// sau: |