Changes to be committed:
deleted: proglabs/lab5/.1.c.swo deleted: proglabs/lab5/.1.c.swp deleted: proglabs/lab5/1.c~ deleted: proglabs/lab5/10 deleted: proglabs/lab5/11 deleted: proglabs/lab5/12 deleted: proglabs/lab5/13 deleted: proglabs/lab5/14 deleted: proglabs/lab5/15 deleted: proglabs/lab5/15.c~ deleted: proglabs/lab5/16 deleted: proglabs/lab5/17 deleted: proglabs/lab5/18 deleted: proglabs/lab5/2 deleted: proglabs/lab5/3-1 deleted: proglabs/lab5/3-2 deleted: proglabs/lab5/4 deleted: proglabs/lab5/5 deleted: proglabs/lab5/5.c~ deleted: proglabs/lab5/6 deleted: proglabs/lab5/7 deleted: proglabs/lab5/a.out renamed: proglabs/lab5/8 -> proglabs/lab6/3 modified: proglabs/lab6/3.c new file: proglabs/lab6/3.c~ renamed: proglabs/lab5/1 -> proglabs/lab6/6 modified: proglabs/lab6/6.c new file: proglabs/lab6/6.c~ renamed: proglabs/lab5/9 -> proglabs/lab6/9 modified: proglabs/lab6/9.c new file: proglabs/lab6/9.c~ new file: proglabs/lab7-8/1.c new file: proglabs/lab7-8/2.c new file: proglabs/lab7-8/3.c new file: proglabs/lab7-8/4.c
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,16 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
char l[26];
|
||||
|
||||
for (int i = 0; i < 26; ++i) {
|
||||
l[i] = 'a' + i;
|
||||
}
|
||||
printf("t-t: ");
|
||||
for (int i = 0; i < 26; ++i) {
|
||||
printf("%c ", l[i]);
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,25 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
#include <locale.h>
|
||||
|
||||
int main() {
|
||||
setlocale(LC_ALL, "");
|
||||
wchar_t s[256];
|
||||
wchar_t c;
|
||||
int n = 0, st = 0;
|
||||
|
||||
printf("write: ");
|
||||
while(st == 0){
|
||||
wscanf(L"%lc", &c);
|
||||
st = (c == '\n');
|
||||
s[n] = c;
|
||||
n = n + (1 - st);
|
||||
}
|
||||
|
||||
while(n > 0) {
|
||||
n -= 1;
|
||||
wprintf(L"%lc", s[n]);
|
||||
}
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,29 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int r = 1;
|
||||
char l, x;
|
||||
scanf("%c", &x);
|
||||
|
||||
for(char z = 'A'; z <= x; ++z)
|
||||
r++;
|
||||
for(int i = 1; i <= r; ++i){
|
||||
l = 'A';
|
||||
|
||||
for(int j = 0; j < r - i; ++j){
|
||||
printf(" ");
|
||||
}
|
||||
|
||||
for(int j = 0; j < i; ++j){
|
||||
printf("%c", l);
|
||||
l++;
|
||||
}
|
||||
l -= 2;
|
||||
for(int j = 0; j < i - 1; ++j){
|
||||
printf("%c", l);
|
||||
l--;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -7,7 +7,7 @@ int main(){
|
||||
a = 1;
|
||||
while(scanf("%d", &a) && a != 0){
|
||||
if (a % 2 == 0){n1++; sum1 += a;}
|
||||
else (n2++; sum2 += a);
|
||||
else ({n2++; sum2 += a;});
|
||||
printf("num: ");
|
||||
}
|
||||
printf("eve nums: %d \t eve summ: %d \t mean: %d\n",n1,sum1,(sum1/n1));
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int a,n1,sum1,n2,sum2;
|
||||
n1 = sum1 = n2 = sum2 = 0;
|
||||
printf("num: ");
|
||||
a = 1;
|
||||
while(scanf("%d", &a) && a != 0){
|
||||
if (a % 2 == 0){n1++; sum1 += a;}
|
||||
if (a % 2 != 0){n2++; sum2 += a;}
|
||||
printf("num: ");
|
||||
}
|
||||
printf("eve nums: %d \t eve summ: %d \t mean: %d\n",n1,sum1,(sum1/n1));
|
||||
printf("odd nums: %d \t odd summ: %d \t mean: %d",n2,sum2,(sum2/n2));
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
+1
-1
@@ -3,7 +3,7 @@
|
||||
int main() {
|
||||
int a,b,c;
|
||||
a = b = c = 0;
|
||||
printf("count ef:\n");
|
||||
printf("count ei:\n");
|
||||
while((a = getchar()) != '#'){
|
||||
if(a == 'i' && b == 'e'){c++;}
|
||||
b = a;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int a,b,c;
|
||||
a = b = c = 0;
|
||||
printf("count ef:\n");
|
||||
while((a = getchar()) != '#'){
|
||||
if(a == 'i' && b == 'e'){c++;}
|
||||
b = a;
|
||||
}
|
||||
printf("count: %d",c);
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
+3
-3
@@ -3,7 +3,7 @@ int pr(long long n);
|
||||
|
||||
int main() {
|
||||
long long int x,i;
|
||||
int y = 1;
|
||||
printf("Num: ");
|
||||
if(!(scanf("%lld",&x)))return 1;
|
||||
|
||||
for(i = x; i > 1; --i)
|
||||
@@ -13,9 +13,9 @@ int main() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pr(long long x) {
|
||||
int pr(long long n) {
|
||||
if (n < 2) return 0;
|
||||
if (n == 2 || x == 3) return 1;
|
||||
if (n == 2 || n == 3) return 1;
|
||||
if (n % 2 == 0 || n % 3 == 0) return 0;
|
||||
|
||||
for (long long i = 5; i * i <= n; i += 6) {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#include <stdio.h>
|
||||
int pr(long long n);
|
||||
|
||||
int main() {
|
||||
long long int x,i;
|
||||
|
||||
if(!(scanf("%lld",&x)))return 1;
|
||||
|
||||
for(i = x; i > 1; --i)
|
||||
if(pr(i))
|
||||
printf("%lld\t",i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pr(long long n) {
|
||||
if (n < 2) return 0;
|
||||
if (n == 2 || n == 3) return 1;
|
||||
if (n % 2 == 0 || n % 3 == 0) return 0;
|
||||
|
||||
for (long long i = 5; i * i <= n; i += 6) {
|
||||
if (n % i == 0 || n % (i + 2) == 0)
|
||||
return 0;}
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
double min(double x, double y);
|
||||
|
||||
int main(){
|
||||
double x,y;
|
||||
printf("Enter: num1 num2\nEnter: ");
|
||||
scanf("%lf %lf",&x,&y);
|
||||
printf("lower: %lf\n",min(x,y));
|
||||
return 0;
|
||||
}
|
||||
|
||||
double min(double x, double y){
|
||||
return ((x>y)?x:y);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
void min(char ch, char i, char j);
|
||||
|
||||
int main(){
|
||||
char ch, i, j;
|
||||
|
||||
printf("Enter: char i j\nEnter: ");
|
||||
scanf(" %c %c %c",&ch,&i,&j);
|
||||
min(ch,i,j);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void min(char ch, char i, char j){
|
||||
int c = i;
|
||||
for(;i<=j;i++){printf("%c\t",i);}
|
||||
printf("\n");
|
||||
i = c;
|
||||
for(;i<=j;i++){printf("%c\t",ch);}
|
||||
printf("\n");
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
void table(char ch, int a, int b);
|
||||
|
||||
int main(){
|
||||
char ch;
|
||||
int a,b;
|
||||
printf("Enter: Char num1 num2\nEnter: ");
|
||||
scanf(" %c %d %d",&ch,&a,&b);
|
||||
table(ch,a,b);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void table(char ch, int a, int b){
|
||||
//for(int i = 0;i<=a;i++){printf("%d",i);}
|
||||
printf("\n");
|
||||
for(int i = 1;i<=b;i++){
|
||||
//printf("%d",i);
|
||||
for(int x = 1;x<=a;x++){printf("%c",ch);}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
double garmony(double a,double b);
|
||||
|
||||
int main(){
|
||||
double a, b;
|
||||
printf("Enter: num1 num2\nEnter: ");
|
||||
scanf(" %lf %lf",&a,&b);
|
||||
printf("garmony = %lf",garmony(a,b));
|
||||
return 0;
|
||||
}
|
||||
|
||||
double garmony(double a, double b){
|
||||
double x;
|
||||
a *= -1;
|
||||
b *= -1;
|
||||
x = (((a+b)/2)*-1);
|
||||
return x;
|
||||
}
|
||||
Reference in New Issue
Block a user