zad z kola z infy.doc

(38 KB) Pobierz
#include <iostream

1)

#include <iostream.h>

#include <conio.h>

 

main()

{

     cout<<076+2uL+0x12;

     getch();

     }

Liczba .....................

   

2)

main()

{

      cout << 5//*

      *//*-3*/

      2<<endl;

      getch();

      }

Liczba .....................

 

3)

main()

{

      int x;

      for (x=0;x<=105;x--)

      x=2*x+8;

      cout<<x;

      getch();

      }

Liczba x wynosi ...............

 

4)

main()

{

      int a=5, b=8, wynik;

      if(b=a) wynik=a*b;

      else wynik=a+b;

cout <<wynik<<endl;

getch();

return 0;

}

Wynik = ............................

 

5)

main(){

int i,j,tab[5][5];

 

for(int i=0;i<5;i++)

  for(int j=0;j<5;j++)

  {

   if((i*j)==0) tab[i][j] = i - j;

   else tab[i][j] = tab[i][j-1] - tab[i-1][j];

   cout<<tab[i][j];

   getch();

  }}

Element tab[4][3] wynosi ...........................

 

 

 

 

 

 

 

6)

{

      int z=0;

      for(int i=5;i<10;i++)

      for(int j=0;j<=i;j++)

      z++;

      cout<<z;

      getch();

      }

Liczba „z” wynosi ....................

 

7)

main()

{

int a,b;

int f(int a, int b);

      {

      if(a==b) return a;

      else return a/b;

      }

      int x;

      x = f(4,2); }

Liczba x wynosi .................

 

8}

main()

{

int x=0;

 

int fib(int n)

{

  x++;

  if(n<2) return 1;

  else return fib(n-1) + fib(n-2);

}

void main()

{

  fib(5);

}

Liczba x wynosi ....................

 

9)

main()

{

 

double f(int a);

cout << "A";

return 1;

 

int f(double a);

cout <<"B";

return 1;

 

f(f(f(1.1)));

f(f(f(1)));

}

Otrzymamy napis ...............................

 

 

 

 

 

 

 

 

 

ODPOWIEDZI

1) 82

2) 10

3) 217

4) 25

5) -24

6) 40

7) 2

8) 14  /?/

9) BABABABABABA

...
Zgłoś jeśli naruszono regulamin