Commit 49371674 by haloog

kommentaar

parent 065461ee
Showing with 29 additions and 0 deletions
#include <stdio.h>
int main(){
int S=0;
int i=0;
int N=0;
while(N<=0){
printf("Sisesta rea pikkus N:");
scanf("%d", &N);
}
int A [N];
do{
scanf("%d", &A[i]);
printf("Sisestatud on %d.", A[i]);
i++;
}while(i<N);
for(i=0;i<=N;i++){
if(A[i]>0&&i<N){
S=S+A[i];
}
}
printf("Positiivsete elementide summa on %d", S);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment