Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Nauka_1.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <conio.h>
- #include <Windows.h>
- int main()
- {
- while (true)
- {
- double suma = 0;
- double n = 0;
- double max = 0;
- double min = 0;
- double srednia = 0;
- while (true)
- {
- double liczba;
- printf("Podaj liczbe ");
- scanf_s("%lf", &liczba);
- if (liczba > max)
- max = liczba;
- if (liczba < min)
- min = liczba;
- while (liczba == 0)
- {
- printf("Suma = %lf \n", suma);
- printf("Srednia = %lf\n", srednia);
- printf("Max = %lf\n", max);
- printf("Min = %lf\n", min);
- _getch();
- suma = 0;
- n =-1;
- break;
- }
- suma += liczba;
- n++;
- srednia = suma / n;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement