Long time no see

This commit is contained in:
2026-02-21 10:47:00 +07:00
parent 0d54fe176e
commit b7df98a55c
198 changed files with 3249 additions and 1 deletions
+60
View File
@@ -0,0 +1,60 @@
#include <stdio.h>
#define arti 2.05
#define svek 1.15
#define carr 1.09
#define skid 0.05
#define zatrporog1 5
#define zatrporog2 20
#define zatrmin 6.50
#define zatrsr 14.00
#define zatrmax 0.5
int main() {
int ch,a,s,c,tmp;
float sk,st,zt;
printf("a - Artishok\nb - Svek\nc -Carrot\nq - quit\nInput: ");
while((ch = getchar())!='q'){
switch(ch){
case 'a':
printf("Arti: ");
scanf("%d",&tmp);
a+=tmp;
break;
case 'b':
printf("svek: ");
scanf("%d",&tmp);
s+=tmp;
break;
case 'c':
printf("Carrot: ");
scanf("%d",&tmp);
c+=tmp;
break;
}
printf("\n\nzakaz:\nArti\tSvek\tCarrot\n%d\t%d\t%d\n",a,s,c);
printf("a - Artishok\nb - Svek\nc - Carrot\nq - deal\nInput: ");
}
if((a>0)||(s>0)||(c>0)){
st = ((a*arti)+(s*svek)+(c*carr));
tmp = (a+s+c);
if(tmp>zatrporog1){
if(tmp>zatrporog2){
zt=(zatrsr+((tmp-zatrporog2)*zatrmax));
}else(zt=zatrsr);
}else(zt=zatrmin);
if(st>100){sk=(st+zt)*skid;}
printf("zakaz: arti-%d Svek-%d Carr-%d\n",a,s,c);
printf("Arti-%d sum-%0.2f stoimost-%0.2f/1\n",a,a*arti,arti);
printf("Svek-%d sum-%0.2f stoimost-%0.2f/1\n",s,s*svek,svek);
printf("Carrot-%d sum-%0.2f stoimost-%0.2f/1\n",c,c*carr,carr);
printf("stoimost-%.2f skidka-%.2f zatrat-%.2f\nitogo: %.2f",st,sk,zt,zt+st-sk);
}
return 0;
}