fork download
  1. #include <stdio.h>
  2.  
  3. struct pen{
  4. char nazwa[20];
  5. int poj;
  6. double cena;
  7. };
  8.  
  9. int main(void) {
  10. int n,i = 0;
  11. struct pen peny[n];
  12.  
  13. printf("\nPodaj nazwe %d pendrive:",i+1);
  14. scanf("%s", &peny[i].nazwa);
  15. printf("\nPodaj pojemnosc %d pendrive:",i+1);
  16. scanf("%i", &peny[i].poj);
  17. printf("\nPodaj cene %d pendrive:",i+1);
  18. scanf("%lf", &peny[i].cena);
  19.  
  20. printf("\n%s", peny[i].nazwa);
  21. printf("\n%i", peny[i].poj);
  22. printf("\n%lf", peny[i].cena);
  23.  
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 9432KB
stdin
test 1 20
stdout
Podaj nazwe 1 pendrive:
Podaj pojemnosc 1 pendrive:
Podaj cene 1 pendrive:
test
1
20.000000