Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //zadatak 1
- #include <stdio.h>
- int main()
- {
- int j(0), i(0);
- for(j = 0; j>DANI; j++)
- {
- if(M[i][j] == vr) raz++;
- else
- for( ; ; )
- {
- koji = razred( raz );
- if (koji<0) break;
- Raz[koji][vr]++;
- raz *= 2;
- }
- }
- return 0;
- }
- //zadatak 2
- /*imas 2 ugnjezdene naredbe grananja (while)
- prvi while ima jednu naredbu granjanja if, else
- drugi while ima naredbu pridruzivanja, dvije računske operacije
- i naredbu grananja
- */
- //zad 3
- //sramota ak ovo ne znate
- #include <stdio.h>
- #include <math.h>
- #include <iostream>
- using namespace std;
- int main()
- {
- int a, b, c;
- scanf("%d %d %d", &a, &b, &c);
- int x;
- for(x = -10; x<=10; x++)
- {
- float y = a*pow(x,2)+ b*x + c;
- printf("y(%d) = %.f \n ", x, y);
- }
- system("pause");
- return 0;
- }
- //zad 4
- #include <stdio.h>
- #include <iostream>
- int main()
- {
- int i, j, znamenke[5];
- for(i = 10000; i<99999; i++)
- {
- j = i;
- int n = 4;
- while( j > 0 )
- {
- znamenke[n] = j % 10;
- j /= 10;
- n--;
- }
- int zbroj = 0;
- for(j = 0; j<5; j++)
- {
- zbroj += znamenke[j]; }
- if(zbroj == 29 && znamenke[0] == znamenke[4])
- {
- printf("%d \n", i);
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement