You are on page 1of 5

Tanasa Eduard – Varianta 1

1c
c.struct carte{int val;char nume[21];}t;

2. d. e.dn.zi
3.
#include <iostream>

#include <cstring>

#include <string>

using namespace std;

int main()

char a[20001];

cin.getline(a, 20000);

char sep[] = " ";

char list[200][200];

int ind = 0;

int cnt = 0;

char *p = strtok(a, sep);

while (p)

strcpy(list[++ind], p);

p = strtok(NULL, sep);

int j;

for (int i = 1; i <= ind; i++)

for (j = 0; list[i][j] != 0; ++j)

j--;

if (strchr("aeiouAEIOU", list[i][0]) && strchr("aeiouAEIOU", list[i][j]))

{
cnt++;

if (cnt != 0)

cout << cnt;

else

cout << "NU EXISTA.";

return 0;

4.
#include <iostream>

#include <cstring>

#include <string>

using namespace std;

struct elev

char nume[20];

float nota;

};

elev e1, e2;

int main()

cin.getline(e1.nume, 21);

cin.getline(e2.nume, 21);

cin >> e1.nota;

cin >> e2.nota;

if (e1.nota == e2.nota || e1.nota > e2.nota)

cout << e1.nume;

else

cout << e2.nume;


return 0;

5a
int P(int n, int c)

int nr = 0;

int p = 1;

while (n)

int cif = n % 10;

if (cif != c)

nr = cif * p + nr, p *= 10;

n = n / 10;

return nr;

5.b
#include <iostream>

#include <cstring>

#include <string>

#include <fstream>

using namespace std;

ifstream fin("EV.IN");

ofstream fout("EV.OUT");

int n,

c;

int P(int n, int c)

int nr = 0;
int p = 1;

while (n)

int cif = n % 10;

if (cif != c)

nr = cif * p + nr, p *= 10;

n = n / 10;

return nr;

void parcurgere()

int nr;

while (fin >> nr)

int copie = nr;

while (copie)

int cif = copie % 10;

if (cif % 2 != 0)

nr = P(nr, cif);

copie = copie / 10;

if (nr)

fout << nr << ' ';

int main()

parcurgere();

6. a = 2, b = 16;
7. a = 2, b = -1;
11. 5, 4
10. a
9. 9
8.
p=prim;

while(p!=NULL)

if(p->info%10==0)

cout<<p->info<<’ ‘;

p=p->adr;

You might also like