Ledger Nano X - The secure hardware wallet
SHARE
TWEET

BinarniZadatakObrazac

BrokeMansPC May 20th, 2020 967 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. struct Okrug {
  5.     char naziv[30];
  6.     int brojGr;
  7.     int brojSl;
  8. };
  9.  
  10. int main()
  11. {
  12.     printf("Ime Prezime\n");
  13.     struct Okrug g;
  14.     FILE *fp;
  15.     fp=fopen("po.dat", "wb");
  16.     do {
  17.         printf("Naziv Okruga:");
  18.         gets(g.naziv);
  19.         if(g.naziv[0] == '\0') break;
  20.         printf("Broj Gradova u okrugu:");
  21.         scanf("%d", &g.brojGr);
  22.         printf("Broj Sela u okrugu:");
  23.         scanf("%d", &g.brojSl);
  24.         while (getchar()!='\n');
  25.             fwrite(&g, sizeof(struct Okrug), 1, fp);
  26.     } while(1);
  27.     fclose(fp);
  28.     fp = fopen("po.dat", "rb");
  29.     while(fread(&g, sizeof(struct Okrug), 1, fp) == 1)
  30.         printf("%s okrug ima %d gradova i %d sela.\n", g.naziv, g.brojGr, g.brojSl);
  31.     fclose(fp);
  32.     return 0;
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top