Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
rur7 authored Dec 27, 2021
1 parent 34973ca commit c6626f6
Show file tree
Hide file tree
Showing 4 changed files with 338 additions and 0 deletions.
52 changes: 52 additions & 0 deletions 4_Лаба_7.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include <iostream>
#include <cmath>

using namespace std;

int x,y,s,z;
string sim;

int main()
{
cout<<"Введите длинну прямоугольника: ";
if (cin>>x)
{
cout <<"Введите высоту прямоугольника: ";
if (cin>>y)
{
if (x<0||y<0)
{
goto eror;
}
cout <<"Ввудите символ, которым будет отрисован прямоугольник: ";
cin>>sim;
z=0;
cout <<endl;
while (z!=y)
{
s=0;
cout <<" ";
while (s!=x)
{
cout <<sim;
s++;
}
cout<<endl;
z++;
}
return 0;
}
else
{
goto eror;
}
}
else
{
goto eror;
}

eror:
cout <<endl<<endl<<endl<<endl<<"Введёные символы некоректны";
return 0;
}
22 changes: 22 additions & 0 deletions 6_Лаба_1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include<iostream>
#include <cmath>

using namespace std;

int main()
{
const int N=15;
int f[N],f0,f1,f2,f3,i,n;
f[0]=0;
f[1]=3;
f[2]=5;
cout<<"f[0] = 0"<<endl<<"f[1] = 3"<<endl;
for (i=2; i<N; i++)
{
f[i+1]=f[i]+f[i-1]+f[i-2];
cout <<"f["<<i<<"] = "<<f[i]<<endl;
}

return 0;

}
147 changes: 147 additions & 0 deletions 6_Лаба_2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
#include<iostream>
#include <cmath>

using namespace std;

int main()
{
int n,t=0,d=1,n1,n2,n3,n4,g,s,s1,s2;
string t1,t2,t3,t4;
cout<<"Введите число: ";
if (cin>>n)
{
goto doo;
}
else
{
goto eror;
}
doo:
n1=n;
n2=n;
n3=n;
n4=0;
while(n)
{
t=t+(n%2)*d;
n=n/2;
d=d*10;
}
cout<<t<<endl;
n=0,t=0,d=1,g=0;
while(n1)
{
t=t+(n1%8)*d;
n1=n1/8;
d=d*10;
}
cout<<t<<endl;
n=0,t=0,d=1,s=0,s1=0,s2=0;
while(n2)
{
n4=n3%16;

if (n4==10)
{
t1='A';
}
if (n4==11)
{
t1='B';
}
if (n4==12)
{
t1='C';
}
if (n4==13)
{
t1='D';
}
if (n4==14)
{
t1='E';
}
if (n4==15)
{
t1='F';
}
if (n4==9)
{
t1='9';
}
if (n4==8)
{
t1='8';
}
if (n4==7)
{
t1='7';
}
if (n4==6)
{
t1='6';
}
if (n4==5)
{
t1='5';
}
if (n4==4)
{
t1='4';
}
if (n4==3)
{
t1='3';
}
if (n4==2)
{
t1='2';
}
if (n4==1)
{
t1='1';
}
if (n4==0)
{
t1='0';
}


if (g==0)
{
t2=t1;
s=1;
}
if (g==1)
{
t3=t1;
s1=1;
}
if (g==2)
{
t4=t1;
s2=1;
}
g++;
n2=n2/16;
n3=n3/16;
d=d*10;
}
if (s2==1)
{
cout <<t4;
}
if (s1==1)
{
cout <<t3;
}
if (s==1)
{
cout <<t2;
}
return 0;

eror:
cout <<endl<<endl<<endl<<endl<<endl<<endl<< "Введённые символы некоректны";
return 0;
}
117 changes: 117 additions & 0 deletions 7_Лаба_2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#include<iostream>
#include <cmath>

using namespace std;

int main()
{
int h,h1,s,s1,k,z,z1;
string t;

cout <<endl;
k=0;
h=4;
s=1;
s1=0;
h1=0;
t='@';
while (h1!=h)
{
cout <<" ";
while(s1!=s)
{
cout <<t;
s1++;
}
s1=0;
s=s+1;
cout <<endl;
h1++;
}

cout <<endl;
k=0;
h=4;
s=4;
s1=0;
h1=0;
t='#';
while (h1!=h)
{
cout <<" ";
while(s1!=s)
{
cout <<t;
s1++;
}
s1=0;
s=s-1;
cout <<endl;
h1++;
}

cout <<endl;
k=0;
h=4;
s=1;
s1=0;
h1=0;
z1=0;
z=4;
t='$';
while (h1!=h)
{
cout <<" ";\
while(z1!=z)
{
cout <<" ";
z1++;
}
z1=0;
z=z-1;
while(s1!=s)
{
cout <<t;
s1++;
}
s1=0;
s=s+1;
cout <<endl;
h1++;
}

cout <<endl;
k=0;
h=4;
s=4;
s1=0;
h1=0;
z1=0;
z=1;
t='%';
while (h1!=h)
{
cout <<" ";\
while(z1!=z)
{
cout <<" ";
z1++;
}
z1=0;
z=z+1;
while(s1!=s)
{
cout <<t;
s1++;
}
s1=0;
s=s-1;
cout <<endl;
h1++;
}



return 0;

}

0 comments on commit c6626f6

Please sign in to comment.