Alx09

inceput problema

May 14th, 2021
772
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main(){
  6.     int v[10000], n, j = 1, i, x, nr = 0, k;
  7.     printf("Numarul de zile: "); scanf("%d", &n);
  8.     printf("Suma de bani: "); scanf("%d", &k);
  9.     for (i = 1; i <= n; i++) {
  10.         nr += i;
  11.         printf("Pretul din ziua %d", i);    scanf("%d", &x);
  12.         while (j <= nr) {
  13.             v[j] = x;
  14.             j++;
  15.         }
  16.     }
  17.  
  18.    
  19.     return 0;
  20.  
  21. }
RAW Paste Data