Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     double input = 0.0;
  6.     double total = 0.0;
  7.     int inputCount = 0;
  8.     for (inputCount; input >= 0.0; inputCount++)
  9.     {
  10.         total += input;
  11.         printf("실수입력 (minus to Quit) : ");
  12.         scanf_s("%lf ", &input);
  13.     }
  14.     inputCount = inputCount - 1;
  15.     printf("평균값 : %lf \n", total / inputCount);
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement