Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, char *argv[])
- { int y[100], p, L, N, pocet;
- printf("vloz pocet cisel:");
- scanf("%i", &N);
- if (N>100) { printf("Prilis mnoho cisel. Restartuj program. \n\n"); system("PAUSE"); return -2; }
- for (L=0; L<N; L=L+1) {
- printf("vloz cislo s poradovym indexem %i:", L+1);
- scanf("%i", &y[L]);
- }
- pocet = 0;
- for (L=0; L<N; L=L+1) {
- if (y[L] < 0)
- pocet = pocet + 1;
- }
- printf("\n\nvypis v opacnem poradi:\n\n");
- for (p=N-1; p>=0; p=p-1) {
- printf("pac. c. %i vyska %i cm\n", p+1, y[p]);
- }
- // printf("\nMezi vlozenymi cisly je %i zapornych.\n\n", pocet);
- system("PAUSE");
- return 0;
- }
- /*
- int poc, L,K, N, M;
- int y[100][100];
- //N=4;
- //y[0]=111; y[1]=222; y[2]=333; y[3]=444;
- scanf("%i", &N);
- scanf("%i", &M);
- for(L=0; L<N; L=L+1)
- for(K=0; K<M; K=K+1)
- {
- printf("vlozte prvek na radku %i a sloupci %i :",L, K );
- scanf("%i", &y[L][K]);
- }
- for(L=0; L<N; L=L+1)
- {
- for(K=0; K<M; K=K+1)
- {
- printf("%i ", y[L][K]);
- }
- printf("\n");
- }
- printf("\n");
- for(L=0; L<N; L=L+1)
- {
- printf("prvek s indexem %i je %i\n", L, y[L]);
- }
- poc=0;
- for(L=0; L<N; L++)
- if(y[L]<0) poc++;
- printf("pocet zapornych je %i \n\n", poc);
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement