From 4d3b81452bfcff0717055cdc9789fecf1d27d494 Mon Sep 17 00:00:00 2001 From: puka89 Date: Tue, 18 Oct 2016 23:14:23 +0300 Subject: [PATCH 01/10] sorry --- B/14/01.c.c | 14 ++++++++++++++ B/14/02.c.c | 26 ++++++++++++++++++++++++++ B/14/03.c.c | 30 ++++++++++++++++++++++++++++++ B/14/04.c.c | 23 +++++++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 B/14/01.c.c create mode 100644 B/14/02.c.c create mode 100644 B/14/03.c.c create mode 100644 B/14/04.c.c diff --git a/B/14/01.c.c b/B/14/01.c.c new file mode 100644 index 000000000..d9f7fdb53 --- /dev/null +++ b/B/14/01.c.c @@ -0,0 +1,14 @@ +#include +#include + +int main() +{ + int a,q,w; + + scanf("%d", &a); + q = a*a; + w = a*a*a; + printf("%d\n", q); + printf("%d", w); + return 0; +} diff --git a/B/14/02.c.c b/B/14/02.c.c new file mode 100644 index 000000000..194aefec4 --- /dev/null +++ b/B/14/02.c.c @@ -0,0 +1,26 @@ +#include +#include + +int main() +{ + float a, b, c, d; + + scanf("%f",&a); + scanf("%f",&b); + scanf("%f",&c); + + d=0; + if(b>a) + { + d=b; + } + if(c>d) + { + d=c; + } + else if(c>a){ + d=c; + } + printf("%f\n",d); + return 0; +} diff --git a/B/14/03.c.c b/B/14/03.c.c new file mode 100644 index 000000000..1c830b797 --- /dev/null +++ b/B/14/03.c.c @@ -0,0 +1,30 @@ +#include +#include + +int main() + { + int n; + + scanf("%d",&n); + if(n==0) + {printf("zero");} + if(n==1) + { printf("one");} + if(n==2) + { printf("two");} + if(n==3) + { printf("three");} + if(n==4) + { printf("four");} + if(n==5) + { printf("five");} + if(n==6) + {printf("six");} + if(n==7) + {printf("seven");} + if(n==8) + {printf("eight");} + if(n==9) + {printf("nine");} + +} diff --git a/B/14/04.c.c b/B/14/04.c.c new file mode 100644 index 000000000..fc42b1132 --- /dev/null +++ b/B/14/04.c.c @@ -0,0 +1,23 @@ +#include +#include + +int main() +{ + int q; + char a,i,e; + i='a'; + e='z'; + q=0; + do{ + printf("vuvedi malka bukva:"); + scanf("%c",&a); + }while(a<'a' || a>'z'); + while(i Date: Wed, 26 Oct 2016 17:59:25 +0300 Subject: [PATCH 02/10] 14 --- B/03/14/01_lol.c | 25 +++++++++++++++++++++++++ B/03/14/02_lol.c | 31 +++++++++++++++++++++++++++++++ B/03/14/03_lol.c | 30 ++++++++++++++++++++++++++++++ B/03/14/04_lol.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 134 insertions(+) create mode 100644 B/03/14/01_lol.c create mode 100644 B/03/14/02_lol.c create mode 100644 B/03/14/03_lol.c create mode 100644 B/03/14/04_lol.c diff --git a/B/03/14/01_lol.c b/B/03/14/01_lol.c new file mode 100644 index 000000000..aadfbb07f --- /dev/null +++ b/B/03/14/01_lol.c @@ -0,0 +1,25 @@ + + + + +#include "stdio.h" + + +int main() { + + int n, s,sum=0; + float avg=0; +scanf("%d",&n); + +for (int i = 0; i < n; ++i) +{ +scanf("%d",&s); +sum = sum + s; +avg = (float)sum/(i+1); + +} + +printf("Sum: %d\nAvg: %.2f",sum,avg); + +return 0; +} \ No newline at end of file diff --git a/B/03/14/02_lol.c b/B/03/14/02_lol.c new file mode 100644 index 000000000..66c0f69c7 --- /dev/null +++ b/B/03/14/02_lol.c @@ -0,0 +1,31 @@ + + + + +#include "stdio.h" + + +int main() { + + int n, s,cif=0; + float avg=0; +scanf("%d",&n); + +for (int i = 0; 0 < n; ++i) +{ +s = n%10; +cif = cif + s; +avg = (float)cif/(i+1); +n /=10; +} +if(avg > 7){ + +printf("heavy"); + +}else{ + +printf("light"); +} + +return 0; +} \ No newline at end of file diff --git a/B/03/14/03_lol.c b/B/03/14/03_lol.c new file mode 100644 index 000000000..e5402ebb2 --- /dev/null +++ b/B/03/14/03_lol.c @@ -0,0 +1,30 @@ + + + + +#include "stdio.h" + + +int main() { + + int n, m, k,sum=0,otstypka=0; +scanf("%d",&n); +scanf("%d",&m); +scanf("%d",&k); + +for (int i = 0; i < n; i+=k) +{ + if(i>=k){ + + otstypka += 0.02*m; + } + + sum = k*(m - otstypka)+sum; + +} + +printf("%d",sum); + + +return 0; +} \ No newline at end of file diff --git a/B/03/14/04_lol.c b/B/03/14/04_lol.c new file mode 100644 index 000000000..5af67e37a --- /dev/null +++ b/B/03/14/04_lol.c @@ -0,0 +1,48 @@ + + + + +#include + +int main() { + + int rows = 1, hash = 0, spaces = 0, number = 0; + + scanf("%d", &number); + number -= 1; + int stars = number, end = 0 ; + + + for (rows = 1; rows <= number * 2; rows += 2) { + if (rows > 2) { + end = end + (rows - 2); + } + } + printf("%d\n", end ); + + for (rows = 1; rows <= number * 2; rows += 2) { + + for (spaces = 1; spaces <= stars; spaces++) { + printf(" "); + } + if (hash > 1) { + printf("*"); + } + + for (hash = 2; hash < rows; hash++) { + printf("#"); + + } + + printf("*"); + printf("\n"); + stars -= 1; + } + + for (int i = 0; i < rows; ++i) + { + printf("*"); + } + + return 0; +} \ No newline at end of file From e84255bd4453f15c225bbc0f8905f3fbbd97f8ce Mon Sep 17 00:00:00 2001 From: puka89 Date: Wed, 26 Oct 2016 23:31:32 +0300 Subject: [PATCH 03/10] 14 --- B/03/14/01_lol1.c | 21 +++++++++++++++++++++ B/03/14/02_lol1.c | 25 +++++++++++++++++++++++++ B/03/14/03_lol1.c | 21 +++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 B/03/14/01_lol1.c create mode 100644 B/03/14/02_lol1.c create mode 100644 B/03/14/03_lol1.c diff --git a/B/03/14/01_lol1.c b/B/03/14/01_lol1.c new file mode 100644 index 000000000..2e6e1194b --- /dev/null +++ b/B/03/14/01_lol1.c @@ -0,0 +1,21 @@ +#include "stdio.h" + +int main() { + + int n,s,m,i; + float q; + m=0; + q=0; + scanf("%d",&n); + + for (i=0;i7){ + printf("heavy"); + }else{ + printf("light"); + } + + return 0; +} diff --git a/B/03/14/03_lol1.c b/B/03/14/03_lol1.c new file mode 100644 index 000000000..c53d7fdd1 --- /dev/null +++ b/B/03/14/03_lol1.c @@ -0,0 +1,21 @@ +#include "stdio.h" + +int main() { + + int n,i,m,q,k,p,d; + p=0; + d=0; + scanf("%d",&n); + scanf("%d",&q); + scanf("%d",&k); + + for (i=0;i=k){ + d+=0.02*q; + } + p=k*(q-d)+p; + } + printf("%d",p); + return 0; +} From 33e7957fa02919031ba1e108f252fba1343ae607 Mon Sep 17 00:00:00 2001 From: puka89 Date: Wed, 26 Oct 2016 23:32:31 +0300 Subject: [PATCH 04/10] Revert "14" This reverts commit e84255bd4453f15c225bbc0f8905f3fbbd97f8ce. --- B/03/14/01_lol1.c | 21 --------------------- B/03/14/02_lol1.c | 25 ------------------------- B/03/14/03_lol1.c | 21 --------------------- 3 files changed, 67 deletions(-) delete mode 100644 B/03/14/01_lol1.c delete mode 100644 B/03/14/02_lol1.c delete mode 100644 B/03/14/03_lol1.c diff --git a/B/03/14/01_lol1.c b/B/03/14/01_lol1.c deleted file mode 100644 index 2e6e1194b..000000000 --- a/B/03/14/01_lol1.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "stdio.h" - -int main() { - - int n,s,m,i; - float q; - m=0; - q=0; - scanf("%d",&n); - - for (i=0;i7){ - printf("heavy"); - }else{ - printf("light"); - } - - return 0; -} diff --git a/B/03/14/03_lol1.c b/B/03/14/03_lol1.c deleted file mode 100644 index c53d7fdd1..000000000 --- a/B/03/14/03_lol1.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "stdio.h" - -int main() { - - int n,i,m,q,k,p,d; - p=0; - d=0; - scanf("%d",&n); - scanf("%d",&q); - scanf("%d",&k); - - for (i=0;i=k){ - d+=0.02*q; - } - p=k*(q-d)+p; - } - printf("%d",p); - return 0; -} From 96b0cf6558c59d75bffc7f72c07b5dd203d41b13 Mon Sep 17 00:00:00 2001 From: puka89 Date: Wed, 26 Oct 2016 23:39:07 +0300 Subject: [PATCH 05/10] Update 01_lol.c --- B/03/14/01_lol.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/B/03/14/01_lol.c b/B/03/14/01_lol.c index aadfbb07f..6d322920c 100644 --- a/B/03/14/01_lol.c +++ b/B/03/14/01_lol.c @@ -1,25 +1,19 @@ - - - - #include "stdio.h" - int main() { - int n, s,sum=0; - float avg=0; -scanf("%d",&n); - -for (int i = 0; i < n; ++i) -{ -scanf("%d",&s); -sum = sum + s; -avg = (float)sum/(i+1); - -} - -printf("Sum: %d\nAvg: %.2f",sum,avg); - -return 0; -} \ No newline at end of file + int n,s,q,i; + float m; + q=0; + m=0; + scanf("%d",&n); + for(i= 0;i Date: Wed, 26 Oct 2016 23:41:59 +0300 Subject: [PATCH 06/10] Update 02_lol.c --- B/03/14/02_lol.c | 46 ++++++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/B/03/14/02_lol.c b/B/03/14/02_lol.c index 66c0f69c7..b3513844b 100644 --- a/B/03/14/02_lol.c +++ b/B/03/14/02_lol.c @@ -1,31 +1,25 @@ - - - - #include "stdio.h" - int main() { - int n, s,cif=0; - float avg=0; -scanf("%d",&n); - -for (int i = 0; 0 < n; ++i) -{ -s = n%10; -cif = cif + s; -avg = (float)cif/(i+1); -n /=10; + int n,s,q,i; + float m; + q=0; + m=0; + + scanf("%d",&n); + for(i=0;07){ + printf("heavy"); + }else{ + printf("light"); + } + + return 0; } -if(avg > 7){ - -printf("heavy"); - -}else{ - -printf("light"); -} - -return 0; -} \ No newline at end of file From 7bc41233e2627569303fa3385ec7279fb6c9101b Mon Sep 17 00:00:00 2001 From: puka89 Date: Wed, 26 Oct 2016 23:45:38 +0300 Subject: [PATCH 07/10] Update 03_lol.c --- B/03/14/03_lol.c | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/B/03/14/03_lol.c b/B/03/14/03_lol.c index e5402ebb2..697810faf 100644 --- a/B/03/14/03_lol.c +++ b/B/03/14/03_lol.c @@ -1,30 +1,21 @@ - - - - #include "stdio.h" - int main() { - int n, m, k,sum=0,otstypka=0; -scanf("%d",&n); -scanf("%d",&m); -scanf("%d",&k); - -for (int i = 0; i < n; i+=k) -{ + int n,m,k,q,p,i; + q=0; + p=0; + + scanf("%d",&n); + scanf("%d",&m); + scanf("%d",&k); + for (i=0;i=k){ - - otstypka += 0.02*m; + p+=0.02*m; } - - sum = k*(m - otstypka)+sum; - + q=k*(m-p)+q; + } + printf("%d",q); + return 0; } - -printf("%d",sum); - - -return 0; -} \ No newline at end of file From 2a399f9c0414ff2ceb4217c52c31c69701a67e28 Mon Sep 17 00:00:00 2001 From: puka89 Date: Wed, 26 Oct 2016 23:45:54 +0300 Subject: [PATCH 08/10] Delete 04_lol.c --- B/03/14/04_lol.c | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 B/03/14/04_lol.c diff --git a/B/03/14/04_lol.c b/B/03/14/04_lol.c deleted file mode 100644 index 5af67e37a..000000000 --- a/B/03/14/04_lol.c +++ /dev/null @@ -1,48 +0,0 @@ - - - - -#include - -int main() { - - int rows = 1, hash = 0, spaces = 0, number = 0; - - scanf("%d", &number); - number -= 1; - int stars = number, end = 0 ; - - - for (rows = 1; rows <= number * 2; rows += 2) { - if (rows > 2) { - end = end + (rows - 2); - } - } - printf("%d\n", end ); - - for (rows = 1; rows <= number * 2; rows += 2) { - - for (spaces = 1; spaces <= stars; spaces++) { - printf(" "); - } - if (hash > 1) { - printf("*"); - } - - for (hash = 2; hash < rows; hash++) { - printf("#"); - - } - - printf("*"); - printf("\n"); - stars -= 1; - } - - for (int i = 0; i < rows; ++i) - { - printf("*"); - } - - return 0; -} \ No newline at end of file From b8dc1ff5a6e0a854d4b48e4fc194a27ea2575f93 Mon Sep 17 00:00:00 2001 From: puka89 Date: Sun, 27 Nov 2016 20:31:36 +0200 Subject: [PATCH 09/10] soo --- B/04/14/01_lol.c | 20 ++++++++++++++++++++ B/04/14/02_lol.c | 25 +++++++++++++++++++++++++ B/04/14/03_lol.c | 32 ++++++++++++++++++++++++++++++++ B/14/01.c.c | 14 -------------- B/14/02.c.c | 26 -------------------------- B/14/03.c.c | 30 ------------------------------ B/14/04.c.c | 23 ----------------------- 7 files changed, 77 insertions(+), 93 deletions(-) create mode 100644 B/04/14/01_lol.c create mode 100644 B/04/14/02_lol.c create mode 100644 B/04/14/03_lol.c delete mode 100644 B/14/01.c.c delete mode 100644 B/14/02.c.c delete mode 100644 B/14/03.c.c delete mode 100644 B/14/04.c.c diff --git a/B/04/14/01_lol.c b/B/04/14/01_lol.c new file mode 100644 index 000000000..c4ead6417 --- /dev/null +++ b/B/04/14/01_lol.c @@ -0,0 +1,20 @@ +#include +int main() +{ + int p; + scanf("%d",&p); + + int q[p],i=1; + + while(i<=p){ + scanf("%d",&q[i]); + i++; + } + i=p; + while(i>0){ + printf("%d\n",q[i]); + i--; + } + + return 0; +} diff --git a/B/04/14/02_lol.c b/B/04/14/02_lol.c new file mode 100644 index 000000000..3540a1dc2 --- /dev/null +++ b/B/04/14/02_lol.c @@ -0,0 +1,25 @@ +#include +int main() +{ + int q; + scanf("%d",&q); + int p[q],k,l=1; + k=0; + do{ + scanf("%d",&p[k]); + if(p[k]%2!=0){ + k++; + } + }while(k +#define max_chars 1000 +int main() +{ + char r[max_chars]; + char q[27]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\0'}; + int p, z, g, l; + z=0; + fgets(r, max_chars, stdin); + g=0; + while(q[g]!='\0'){ + p=0; + z=0; + l=0; + while(r[p]!='\0'){ + if(r[p] >= 'A' && r[p] <= 'Z'){ + r[p]=r[p]+32; + } + if(q[g] == r[p]){ + z++; + l=1; + } + p++; + } + if(l){ + printf("%c - %d\n", q[g], z); + } + g++; + } + + return 0; +} diff --git a/B/14/01.c.c b/B/14/01.c.c deleted file mode 100644 index d9f7fdb53..000000000 --- a/B/14/01.c.c +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include - -int main() -{ - int a,q,w; - - scanf("%d", &a); - q = a*a; - w = a*a*a; - printf("%d\n", q); - printf("%d", w); - return 0; -} diff --git a/B/14/02.c.c b/B/14/02.c.c deleted file mode 100644 index 194aefec4..000000000 --- a/B/14/02.c.c +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -int main() -{ - float a, b, c, d; - - scanf("%f",&a); - scanf("%f",&b); - scanf("%f",&c); - - d=0; - if(b>a) - { - d=b; - } - if(c>d) - { - d=c; - } - else if(c>a){ - d=c; - } - printf("%f\n",d); - return 0; -} diff --git a/B/14/03.c.c b/B/14/03.c.c deleted file mode 100644 index 1c830b797..000000000 --- a/B/14/03.c.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include - -int main() - { - int n; - - scanf("%d",&n); - if(n==0) - {printf("zero");} - if(n==1) - { printf("one");} - if(n==2) - { printf("two");} - if(n==3) - { printf("three");} - if(n==4) - { printf("four");} - if(n==5) - { printf("five");} - if(n==6) - {printf("six");} - if(n==7) - {printf("seven");} - if(n==8) - {printf("eight");} - if(n==9) - {printf("nine");} - -} diff --git a/B/14/04.c.c b/B/14/04.c.c deleted file mode 100644 index fc42b1132..000000000 --- a/B/14/04.c.c +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include - -int main() -{ - int q; - char a,i,e; - i='a'; - e='z'; - q=0; - do{ - printf("vuvedi malka bukva:"); - scanf("%c",&a); - }while(a<'a' || a>'z'); - while(i Date: Sun, 27 Nov 2016 20:34:48 +0200 Subject: [PATCH 10/10] let's see --- B/04/14/{01_lol.c => 01_lol1.c} | 0 B/04/14/{02_lol.c => 02_lol1.c} | 0 B/04/14/{03_lol.c => 03_lol1.c} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename B/04/14/{01_lol.c => 01_lol1.c} (100%) rename B/04/14/{02_lol.c => 02_lol1.c} (100%) rename B/04/14/{03_lol.c => 03_lol1.c} (100%) diff --git a/B/04/14/01_lol.c b/B/04/14/01_lol1.c similarity index 100% rename from B/04/14/01_lol.c rename to B/04/14/01_lol1.c diff --git a/B/04/14/02_lol.c b/B/04/14/02_lol1.c similarity index 100% rename from B/04/14/02_lol.c rename to B/04/14/02_lol1.c diff --git a/B/04/14/03_lol.c b/B/04/14/03_lol1.c similarity index 100% rename from B/04/14/03_lol.c rename to B/04/14/03_lol1.c