You are on page 1of 2

SUBIECTUL I

1. C.
2. C
3. A
4. D
5. B

SUBIECTUL II

1) a. 4
b. 19 20
c.

#include <iostream>

using namespace std;

int n,nr,i,j,x,y,r;

int main()
{
cin>>n;
nr = 0, i= 1;
while(i <= n)
{
x = 0, y = 1,j =1;
while(j < i)
{
r = 2 * x - y;
x ccccCCczzz

z
z y;
y = r;
j = j + 1;
}
i = i + 1;
if(y > 0)
nr = nr + 1;
}
cout<<nr;
return 0;
}
2). 6,10

3).

i=3;
for(j=0; j<n; j++)
a[i][j] = j + 1;
i=2,j=0;
while(i >= 0)
{ j=0;
while(j < 5)
{
if(j == 0)
a[i][j] = a[i+1][5-1] + 1;
else
{
a[i][j]=a[i][j-1]+1;
}
j++;
}
i--;
}

SUBIECTUK III

1)

void prodprim (int n, int & p)


{
int d=2;
p=1;
while (d <= n/2)
{ if(n % d == 0)
p=p*d;
while(n % d == 0)
n=n/d;
d++;
}
}
int

2)

You might also like