Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Create 04_domashno4.4.c #985

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions G/04/22/04_domashno4.4.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include<stdio.h>
int main()
{
int s=1,j,z=0;
float mas[64],t,sum=0;
for(j=0;scanf("%f", &t)!=EOF;){
for(int i=0;i<j;i++){
s=1;
if(mas[i]==t){
s=0;
break;}}
if(s==1){
mas[j]=t;
z++;j++;}
}
printf("%d\n", z);
for(int i=0;i<j;i++){
while(1){
if(mas[i]-z>=0)
mas[i]=mas[i]-z;
else
break;}
sum=mas[i]+sum;
}
printf("%.3f", sum);
return 0;
}