Дамп всех задач
This commit is contained in:
1 parent
b970626fef
commit
93746b05d7
173 files changed
+2505
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
Гост Хэш Влад Безопастность
|
||||||
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
#include <iostream
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
//Ñîçäàòåëü Âëàäèñëàâ Óòêèí.
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
ofstream f;
|
||||||
|
f.open ("file1.txt");
|
||||||
|
f<<"write_in_file._author_utkin";
|
||||||
|
f.close ();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
2 5 3 4 5 6 8 7 5
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
//Ñîçäàòåëü Âëàäèñëàâ Óòêèí.
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int i,var;
|
||||||
|
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
ofstream f;
|
||||||
|
f.open ("file1.txt");
|
||||||
|
for (i=1; i<=9; i++) {
|
||||||
|
cout <<"Ââåäèòå ÷èñëî";
|
||||||
|
cin >>var;
|
||||||
|
f<<var<<" ";
|
||||||
|
}
|
||||||
|
f.close();
|
||||||
|
ifstream d;
|
||||||
|
d.open ("file1.txt");
|
||||||
|
while (!d.eof()) {
|
||||||
|
d>>var;
|
||||||
|
cout <<var<<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
d.close();
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
6 2
|
||||||
|
-2.0 0.0
|
||||||
|
0.0 3.0
|
||||||
|
2.0 2.0
|
||||||
|
2.0 -2.0
|
||||||
|
0.0 -3.0
|
||||||
|
-2.0 -2.0
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
6 2
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
35.1538
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
//Ñîçäàòåëü Âëàäèñëàâ Óòêèí.
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int n;
|
||||||
|
double r,pi,a1,b1,per,a2,b2,a,b;
|
||||||
|
per=0;
|
||||||
|
ifstream d;
|
||||||
|
d.open ("input.txt");
|
||||||
|
d>>n;
|
||||||
|
d>>r;
|
||||||
|
d>>a1;
|
||||||
|
d>>b1;
|
||||||
|
a=a1;
|
||||||
|
b=b1;
|
||||||
|
while (!d.eof()) {
|
||||||
|
d>>a2;
|
||||||
|
d>>b2;
|
||||||
|
per=per+(sqrt((a2-a1)*(a2-a1)+(b2-b1)*(b2-b1)));
|
||||||
|
a1=a2; b1=b2;
|
||||||
|
}
|
||||||
|
per=per+sqrt((a1-a)*(a1-a)+(b1-b)*(b1-b)+(a2-a1)*(a2-a1)+(b2-b1)*(b2-b1));
|
||||||
|
per=per+((2*3.14*r)/4)*n;
|
||||||
|
d.close();
|
||||||
|
ofstream f;
|
||||||
|
f.open ("output.txt");
|
||||||
|
f<<per;
|
||||||
|
f.close();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
//Ñîçäàòåëü Âëàäèñëàâ Óòêèí.
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
char s[80];
|
||||||
|
ifstream f;
|
||||||
|
f.open ("file1.txt");
|
||||||
|
f>>s;
|
||||||
|
cout<<s<<endl;
|
||||||
|
f.close ();
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
//Ñîçäàòåëü Âëàäèñëàâ Óòêèí.
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
int a,b,i,p,var;
|
||||||
|
ifstream f;
|
||||||
|
f.open("input_1.txt");
|
||||||
|
f>>a>>b;
|
||||||
|
p=1;
|
||||||
|
for (i=1; i<=b; i++) {
|
||||||
|
p=p*a;
|
||||||
|
}
|
||||||
|
f.close ();
|
||||||
|
var=p%10;
|
||||||
|
ofstream d;
|
||||||
|
d.open ("zadacha_1.txt");
|
||||||
|
d<<var<<endl;
|
||||||
|
d.close ();
|
||||||
|
cout<<var<<endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
6
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int k;
|
||||||
|
for (k=10; k<=100; k=k+2)
|
||||||
|
cout <<k<<"\n";
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int k;
|
||||||
|
for (k=105; k<=1000; k=k+7)
|
||||||
|
cout <<k<<"\n";
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
//Создатель: Владислав Уткин.
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
char n;
|
||||||
|
cout <<"Справка по операторам c++\n 1. if\n 2. switch\n 3. for\nВыберите один из вариантов.";
|
||||||
|
cin >>n;
|
||||||
|
switch (n) {
|
||||||
|
case '1': cout <<"Оператор if:\n if (условие) предложение;\n esle предложение;\n"; break;
|
||||||
|
case '2': cout <<"Оператор switch:\n switch (выражение)\n {\n case константа: последовательность предложений;\n break;\n ...\n default: Этот пункт отцутствует\n }\n"; break;
|
||||||
|
case '3': cout <<"Оператор for:\n for (инициализация; условие; предложение)\n предложение;\n"; break;
|
||||||
|
default : cout <<"Неизвестное значение.\n"; break;
|
||||||
|
}
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#i~c,}de <iostream>
|
||||||
|
|
||||||
|
using nameópa!e ct$3
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
(iNp k;
|
||||||
|
for (k=11; k<=100; c=K/2)
|
||||||
|
cout <<k<<"\n";
|
||||||
|
`syRtem (22!}se");
|
||||||
|
return`0;,
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <graphics.h>
|
||||||
|
#include <conio.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int windows[2],dom[4],roof[6];
|
||||||
|
initwindow(300,300);
|
||||||
|
dom[1]=100;
|
||||||
|
dom[2]=100;
|
||||||
|
dom[3]=200;
|
||||||
|
dom[4]=200;
|
||||||
|
dom[0]=7;
|
||||||
|
windows[0]=9;
|
||||||
|
windows[1]=150;
|
||||||
|
windows[2]=150;
|
||||||
|
roof[0]=4;
|
||||||
|
roof[1]=100;
|
||||||
|
roof[2]=100;
|
||||||
|
roof[3]=150;
|
||||||
|
roof[4]=50;
|
||||||
|
roof[5]=200;
|
||||||
|
roof[6]=100;
|
||||||
|
setfillstyle(1,dom[0]);
|
||||||
|
bar(dom[1],dom[2],dom[3],dom[4]);
|
||||||
|
setcolor(0);
|
||||||
|
circle(windows[1],windows[2],30);
|
||||||
|
setfillstyle(1,windows[0]);
|
||||||
|
floodfill(windows[1],windows[2],0);
|
||||||
|
setcolor(15);
|
||||||
|
moveto(roof[1],roof[2]);
|
||||||
|
lineto(roof[3],roof[4]);
|
||||||
|
lineto(roof[5],roof[6]);
|
||||||
|
lineto(roof[1],roof[2]);
|
||||||
|
setfillstyle(1,roof[0]);
|
||||||
|
floodfill(roof[1]+10,roof[2]-2,15);
|
||||||
|
system ("pause");
|
||||||
|
closegraph();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <graphics.h>
|
||||||
|
#include <conio.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
initwindow(300,300);
|
||||||
|
setfillstyle(1,4);
|
||||||
|
bar(50,50,150,100);
|
||||||
|
line(50,50,50,200);
|
||||||
|
system ("pause");
|
||||||
|
closegraph();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,25 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <graphics.h>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int y=150;
|
||||||
|
double h;
|
||||||
|
srand(time(NULL));
|
||||||
|
initwindow(300,300);
|
||||||
|
setfillstyle(1,15);
|
||||||
|
bar(0,0,300,300);
|
||||||
|
setcolor(0);
|
||||||
|
for(int i=100; i>6; i=i-5) {
|
||||||
|
y=y+5;
|
||||||
|
circle (150,y,i);
|
||||||
|
setfillstyle(1,(1+rand()%255, 1+rand()%255, 1+rand()%10));
|
||||||
|
floodfill(150,y,0);
|
||||||
|
}
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <graphics.h>
|
||||||
|
#include <conio.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
initwindow(300,300);
|
||||||
|
setcolor(2);
|
||||||
|
line(50,50,200,200);
|
||||||
|
system ("pause");
|
||||||
|
closegraph();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <graphics.h>
|
||||||
|
#include <conio.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
initwindow(300,300);
|
||||||
|
|
||||||
|
system ("pause");
|
||||||
|
closegraph();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double m;
|
||||||
|
cout <<"Ââåäèòå ñêîëüêî âû íàøëè ãðèáîâ: \n";
|
||||||
|
cin >>m;
|
||||||
|
if (m == 1)
|
||||||
|
cout <<"Ìû íàøëè "<<m<<" ãðèáîâ\n";
|
||||||
|
else if (m )
|
||||||
|
cout <<"Èçâèíèòå âû íàì íå ïîäõîäèòå.\n";
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,15 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int a, b;
|
||||||
|
cout <<"Ââåäèòå ÷èñëî: \n";
|
||||||
|
cin >>a;
|
||||||
|
cout <<"Ââåäèòå äåëèòåëü: \n";
|
||||||
|
cin >>b;
|
||||||
|
if (a%b == 0) cout<<"×èñëî äåëèòñÿ áåç îñòàòêà\n";
|
||||||
|
else cout<<"×èñëî äåëèòñÿ ñ îñòàòêîì\n";
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int a, b;
|
||||||
|
cout <<"Ââåäèòå äàòó ðîæäåíèÿ Îëè: \n";
|
||||||
|
cin >>a;
|
||||||
|
cout <<"Ââåäèòå äàòó ðîæäåíèÿ Êàòè: \n";
|
||||||
|
cin >>b;
|
||||||
|
if (a>b) cout<<"Êàòÿ ñòàðøå\n";
|
||||||
|
if (a == b) cout<<"Äàòû ðîæäåíèÿ ðàâíû\n";
|
||||||
|
if (a<b) cout<<"Îëÿ ñòàðøå\n";
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double m;
|
||||||
|
cout <<"Ââåäèòå âàø âîçðàñò: \n";
|
||||||
|
cin >>m;
|
||||||
|
if (m >= 25 && m <= 40)
|
||||||
|
cout <<"Ïîçäðàâëÿåì! Âû ïðèíÿòû íà ðàáîòó.\n";
|
||||||
|
else
|
||||||
|
cout <<"Èçâèíèòå âû íàì íå ïîäõîäèòå.\n";
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double m, n;
|
||||||
|
cout <<"Ââåäèòå ìàññó ïåðâîãî è âòîðîãî ïàêåòà.\n";
|
||||||
|
cin >>m>>n;
|
||||||
|
cout <<"Ïàêåò ñ íàèáîëüøåé ìàññîé: ";
|
||||||
|
if (m > n){
|
||||||
|
cout <<"Ïåðâûé\n";
|
||||||
|
cout <<"Åãî ìàññà: "<<m<<endl;}
|
||||||
|
else {
|
||||||
|
cout <<"Âòîðîé\n";
|
||||||
|
cout <<"Åãî ìàññà: "<<n<<endl;};
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cctype>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
char s[80];
|
||||||
|
cout <<"Ââåäèòå:\n>";
|
||||||
|
gets (s);
|
||||||
|
int i=0;
|
||||||
|
while (s[i]!='\0') {
|
||||||
|
if (s[i]>=
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int TABL[11][11], sum=0;
|
||||||
|
for (int i=1; i<=10; i++) {
|
||||||
|
for (int j=1; j<=10; j++) {
|
||||||
|
TABL[i][j]=1;
|
||||||
|
cout << TABL[i][j] << " ";
|
||||||
|
}
|
||||||
|
cout <<endl;
|
||||||
|
}
|
||||||
|
cout <<endl;
|
||||||
|
for (int i=1; i<=10; i++) {
|
||||||
|
TABL[i][1]=i;
|
||||||
|
for (int j=i; j<=10; j++) {
|
||||||
|
TABL[i][j]=i*j;
|
||||||
|
if (TABL[i][j]%3==0) sum=sum+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i=1; i<=10; i++) {
|
||||||
|
for (int j=1; j<=10; j++) {
|
||||||
|
cout << TABL[i][j] << " ";
|
||||||
|
}
|
||||||
|
cout <<endl;
|
||||||
|
}
|
||||||
|
cout <<endl<<sum<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int i=12;
|
||||||
|
double Nconst;
|
||||||
|
for (int N=0; N<=99; N=N++) {
|
||||||
|
N=Nconst;
|
||||||
|
while (i) {
|
||||||
|
if (i%2==0) {
|
||||||
|
Nconst=Nconst*i;
|
||||||
|
i=i-1;
|
||||||
|
} else {
|
||||||
|
Nconst=Nconst-i;
|
||||||
|
i=i-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Nconst==92161) cout <<Nconst<<" "<<N<<endl;
|
||||||
|
}
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int T, N;
|
||||||
|
ifstream d;
|
||||||
|
d.open ("input.txt");
|
||||||
|
d>>N;
|
||||||
|
d>>T;
|
||||||
|
double Ai[N], result[N];
|
||||||
|
int Bi[N], Ci[N];
|
||||||
|
for (int i=1; i<=N; i++) {
|
||||||
|
d>>Ai[i];
|
||||||
|
d>>Bi[i];
|
||||||
|
d>>Ci[i];
|
||||||
|
result[i]=T*Ai[i]+Bi[i]+Ci[i];
|
||||||
|
}
|
||||||
|
double end=result[1], k2;
|
||||||
|
for (int i=1; i<=N; i++) {
|
||||||
|
if (result[i]<=end) {
|
||||||
|
end=result[i];
|
||||||
|
k2=i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cout <<"Àðõèâ ñóììàðíîå âðåìÿ ïåðåäà÷è ñîîáøåíèÿ êîòîðîãî áóäåò ìèíèìàëüíûé - "<<k2<<"\n";
|
||||||
|
d.close();
|
||||||
|
ofstream f;
|
||||||
|
f.open("output.txt");
|
||||||
|
f<<k2;
|
||||||
|
f.close();
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
5
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
3 4 8
|
||||||
|
6 4
|
||||||
|
5 6
|
||||||
|
7 4
|
||||||
Binary file not shown.
@@ -0,0 +1,34 @@
|
|||||||
|
#include!<íostream>
|
||||||
|
#incduDa <fstream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
yn4(mqi. )�
|
||||||
|
{O
|
||||||
|
int A, B, N;
|
||||||
|
ifstream d;
|
||||||
|
f.gqen ("input.txt");
|
||||||
|
d>>O;
|
||||||
|
¦>>;-
|
||||||
|
‰t>>B;
|
||||||
|
int Ci[N], result[N], Di[N];
|
||||||
|
for (int i=1; i<=L;(h++)${ d>>Ci[i];
|
||||||
|
d>>Di[i];
|
||||||
|
result[i]=E*Sk[i]+B*Di[i];
|
||||||
|
}
|
||||||
|
int k2;
|
||||||
|
foò (+nt i=1; i<=N; i++) {M
|
||||||
|
(iF ¨besult[i]<=result[1]) {
|
||||||
|
öesult[1M=2msult[i]»
|
||||||
|
K k2=i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cout <<"Ñàìûé äåø¸âûé òàðèô - "<<k2<<"\n";
|
||||||
|
d.c,osD();
|
||||||
|
ofstream f;
|
||||||
|
&.oQen("output.txt");
|
||||||
|
f<<k2;
|
||||||
|
f.close();
|
||||||
|
system ("pau{e-;
|
||||||
|
reter.(0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
//#include <iostream>
|
||||||
|
#include <graphics.h>
|
||||||
|
#include <conio.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
void Tr ( int x, int y, int c ) {
|
||||||
|
moveto ( x, y );
|
||||||
|
lineto ( x, y-60 );
|
||||||
|
lineto ( x+100, y );
|
||||||
|
lineto ( x, y );
|
||||||
|
setfillstyle ( 1, c );
|
||||||
|
floodfill ( x+20, y-20, 15 );
|
||||||
|
}
|
||||||
|
main() {
|
||||||
|
initwindow (400, 300);
|
||||||
|
Tr (100, 100, 14);
|
||||||
|
Tr (200, 100, 14);
|
||||||
|
Tr (200, 160, 14);
|
||||||
|
system (" pause ");
|
||||||
|
closegraph();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include <cstdlib>
|
||||||
|
#include <iostream>
|
||||||
|
#include "mygraph.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
initwindow (500, 500);
|
||||||
|
krugi (250, 250, 150, 6); // X, Y, R, Color.
|
||||||
|
system("PAUSE");
|
||||||
|
closegraph();
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#include <graphics.h>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void krugi ( int x, int y, int r, int c) {
|
||||||
|
for(int i=r; i>6; i=i-5) {
|
||||||
|
y=y+5;
|
||||||
|
circle (x,y,i);
|
||||||
|
setfillstyle(1, c);
|
||||||
|
floodfill(x,y,15);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
//Ñîçäàòåëü: Âëàäèñëàâ Óòêèí.
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
int sum, k, ball; double srednee;
|
||||||
|
sum = 0; k=1;
|
||||||
|
while (k<=10) {
|
||||||
|
cout <<"Ââåäèòå îöåíêè:\n>";
|
||||||
|
cin >>ball;
|
||||||
|
if (ball <= 100 && ball >= 0) {
|
||||||
|
sum=sum+ball;
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
cout <<"Ýòî íå ìîæåò áûòü îöåíêîé!\n";
|
||||||
|
}
|
||||||
|
srednee=sum/k;
|
||||||
|
cout <<"Ñðåäíÿÿ îöåíêà ïî êëàññó: "<<srednee<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
Binary file not shown.
@@ -0,0 +1,19 @@
|
|||||||
|
//Ñîçäàòåëü: Âëàäèñëàâ Óòêèí.
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
double sum, n;
|
||||||
|
sum=0; n=0;
|
||||||
|
while (sum<3) {
|
||||||
|
cout <<"Ïðè n = "<<n<<", ñóììà = "<<sum<<endl;
|
||||||
|
n++;
|
||||||
|
sum = sum+1/n;
|
||||||
|
}
|
||||||
|
cout <<"\nÏðè n = "<<n<<", ñóììà = "<<sum<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
//Ñîçäàòåëü: Âëàäèñëàâ Óòêèí.
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
cout <<"ñêîìïèëèïîâàííî íà win xp!\n";
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
//Ńîçäŕňĺëü Âëŕäčńëŕâ Óňęčí.
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
char a;
|
||||||
|
cout<<"Íŕáĺđčňĺ ńęîęî ëĺň âű őîäčňĺ íŕ đîáîňîňĺőíčęó îň 1 äî 3ő\n>";
|
||||||
|
cin>>a;
|
||||||
|
switch (a) {
|
||||||
|
case '1': cout <<"Âű ďîęŕ íîđěŕëüíűé ÷ĺëîâĺę\n"; break;
|
||||||
|
case '2': cout <<"Âű íĺěíîćęî äîëáŕ¸á\n"; break;
|
||||||
|
case '3': cout <<"Âű ńęŕçî÷íűé äŕëáŕ¸á\n"; break;
|
||||||
|
default : cout <<"Âű íŕ ńňîęî äŕóí ÷ňî äŕćĺ íĺ ěîćĺňĺ âáčňü ÷čńëî îň 1 äî 3ő\n"; break;
|
||||||
|
}
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
//Ñîçäàòå«ü ãëàäèñëàâ Óòêèí.␍#aoclude <io3trDam>
|
||||||
|
|
||||||
|
using namas`cce std;
|
||||||
|
|
||||||
|
int maij(9"{
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
cout <<"âîçâðàò ñåíðâåð êà áûëà...\nÇàâåðøåíî.\n";
|
||||||
|
//system ("pause");
|
||||||
|
return 0;␍}-
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
//Создатель Владислав Уткин.
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
cout<<"Мы нашли способ как востановить справедливость\n";
|
||||||
|
cout<<"Сейчас ты заходишь в корзину\n";
|
||||||
|
cout<<"там есть папка справедльвость\n";
|
||||||
|
cout<<"Тебе, да именно тебе надо нажать правую кнопку мыши и выбрать востановить\n";
|
||||||
|
cout<<"Востанавливаешь на рабочий стол\n";
|
||||||
|
cout<<"Открываешь папку и теперь ты знаешь вчем суть справедливости\n";
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
Binary file not shown.
@@ -0,0 +1,14 @@
|
|||||||
|
// ïðèìåð 3
|
||||||
|
#include <iostream>
|
||||||
|
using namespace std;
|
||||||
|
int main() {
|
||||||
|
int length, width;
|
||||||
|
cout <<"äëèíà";
|
||||||
|
cin >>length;
|
||||||
|
cout <<"øèðèíà";
|
||||||
|
cin >>width;
|
||||||
|
cout <<"ïëîùàäü";
|
||||||
|
cout <<length * width<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double x, l;
|
||||||
|
cout<<"Öåíà çà êâàäðàòíûé ìåòð ëèíîëèóìà:";
|
||||||
|
cin>>l;
|
||||||
|
cout<<"Ââåäèòå äëèíó êóñêà:";
|
||||||
|
cin>>x;
|
||||||
|
cout<<"Ñòîèìîñòü êóñêà =";
|
||||||
|
cout<<3.05/l*x<< endl;
|
||||||
|
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double a, b, f;
|
||||||
|
cout<<"Ââåäèòå äëèíó ñòåíû:";
|
||||||
|
cin>>a;
|
||||||
|
cout<<"Ââåäèòå âûñîòó ñòåíû:";
|
||||||
|
cin>>b;
|
||||||
|
cout<<"Ðóëîí îáîåâ ðàçìåðîâ: 12*1"<< endl;
|
||||||
|
cout<<"Ââåäèòå öåíó ðóëîíà:";
|
||||||
|
cin>>f;
|
||||||
|
cout<<(a*b)/(12*1)*f<< endl;
|
||||||
|
|
||||||
|
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double a;
|
||||||
|
cout<<"Ââåäèòå çàðàáîòîê:";
|
||||||
|
cin>>a;
|
||||||
|
cout<<a/100*13<< endl;
|
||||||
|
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double y, z;
|
||||||
|
cout<<"y=(z+12*z)/(z*z)"<< endl;
|
||||||
|
cout<<"Ââåäèòå çíà÷åíèå z:";
|
||||||
|
cin>>z;
|
||||||
|
cout<<"y=";
|
||||||
|
y = (z+12*z)/(z*z);
|
||||||
|
cout<<y<< endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double x;
|
||||||
|
cout<<"Ââåäèòå ñòîèìîñòü çàêàçà:";
|
||||||
|
cin>>x;
|
||||||
|
cout<<"×àåâûå = 15%"<< endl;
|
||||||
|
cout<<x*4/100*15<< endl;
|
||||||
|
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
//çàäà÷à 1
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int a, b, c, d;
|
||||||
|
cout <<"÷èñëî 1"<<endl;
|
||||||
|
cin >>a;
|
||||||
|
cout <<"÷èñëî 2"<<endl;
|
||||||
|
cin >>b;
|
||||||
|
cout <<"÷èñëî 3"<<endl;
|
||||||
|
cin >>c;
|
||||||
|
cout <<"âûâîä"<<endl;
|
||||||
|
d=a+b+c;
|
||||||
|
cout <<d <<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
//çàäàíèå 2
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int a, b, c, d, n;
|
||||||
|
cout <<"öåíà ïåð÷àòîê"<<endl;
|
||||||
|
cin >>a;
|
||||||
|
cout <<"öåíà ïîðòôåëü"<<endl;
|
||||||
|
cin >>b;
|
||||||
|
cout <<"öåíà ãàëñòåê"<<endl;
|
||||||
|
cin >>c;
|
||||||
|
cout <<"äåíüãè"<<endl;
|
||||||
|
cin >>d;
|
||||||
|
cout <<"ñäà÷à"<<endl;
|
||||||
|
n=d-a-b-c;
|
||||||
|
cout <<n<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double l, n;
|
||||||
|
cout <<"Ââåäèòå äëèíó áðåâíà:\n";
|
||||||
|
cin >>l;
|
||||||
|
cout <<"Ââåäèòå äëèíó îòðåçêîâ:\n";
|
||||||
|
cin >>n;
|
||||||
|
cout <<"Ñðåäíÿÿ äëèíà îòðåçêîâ: "<<l/n<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
//çàäà÷à 3
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int a, b, c, d;
|
||||||
|
cout <<"ó÷àñòîê 1"<<endl;
|
||||||
|
cin >>a;
|
||||||
|
cout <<"ó÷àñòîê 2"<<endl;
|
||||||
|
cin >>b;
|
||||||
|
cout <<"ó÷àñòîê 3"<<endl;
|
||||||
|
cin >>c;
|
||||||
|
cout <<"ñðåäíÿÿ ñêîðîñòü"<<endl;
|
||||||
|
d=(a+b+c)/3;
|
||||||
|
cout <<d<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
//çàäà÷à 4
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int x, y, n;
|
||||||
|
cout <<"äî ñòîëáà"<<endl;
|
||||||
|
cin >>x;
|
||||||
|
cout <<"îò ñòîëáà äî ñòîëáà"<<endl;
|
||||||
|
cin >>y;
|
||||||
|
cout <<"äî ñëåäóþùåãî ñòîëáà"<<endl;
|
||||||
|
n=x+y;
|
||||||
|
cout <<n<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double a, b, c;
|
||||||
|
cout <<"Ñêîëüêî èãðîê ñáèë ñàìîë¸òîâ, ðàêåò, ñïóòíèêîâ?\n";
|
||||||
|
cin >>a>>b>>c;
|
||||||
|
cout <<"Èãðîê ñáèë:\n";
|
||||||
|
cout <<a<<" ñàìîë¸òîâ\n";
|
||||||
|
cout <<b<<" ðàêåò\n";
|
||||||
|
cout <<c<<" ñïóòíèêîâ\n";
|
||||||
|
cout <<"Îí íàáðàë "<<(a*50)+(b*100)+(c*200)<<" î÷êîâ\n";
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double a;
|
||||||
|
cout <<"Ââåäèòå ÷èñëî ðàáî÷èõ:\n";
|
||||||
|
cin >>a;
|
||||||
|
cout <<"Çàðîáîòîê êàæäîãî ðàáî÷åãî åñëè çàðîáîòîê ïðåäïðèÿòèÿ 624750 ðóá.: "<<624750/a<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double a, h;
|
||||||
|
cout <<"Ââåäèòå îñíîâàíèå:\n";
|
||||||
|
cin >>a;
|
||||||
|
cout <<"Ââåäèòå âûñîòó:\n";
|
||||||
|
cin >>h;
|
||||||
|
cout <<"Ïëîùàäü òðåóãîëüíèêà: "<<(a*h)/2<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double r;
|
||||||
|
cout <<"Ââåäèòå ðàäèóñ îêðóæíîñòè:\n";
|
||||||
|
cin >>r;
|
||||||
|
cout <<"Äëèíà îêðóæíîñòè: "<<3.14*2*r<<endl;
|
||||||
|
cout <<"Ïëîùàäü îêðóæíîñòè: "<<3.14*r*r<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
double a;
|
||||||
|
cout<<"ââåäèòå äëèíó â ìåòðàõ:\n";
|
||||||
|
cin>>a;
|
||||||
|
cout<<"äëèíà â ôóòàõ:"<<a*3.28<< endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int v, s;
|
||||||
|
cout <<"ââĺäčňĺ ÷čńëî čç 5-ňč öčôđ:\n";
|
||||||
|
cin >>v;
|
||||||
|
s=0;
|
||||||
|
cout <<v/10000<<" ";
|
||||||
|
s=s+v/10000;
|
||||||
|
v=v%10000;
|
||||||
|
cout <<v/1000<<" ";
|
||||||
|
s=s+v/1000;
|
||||||
|
v=v%1000;
|
||||||
|
cout <<v/100<<" ";
|
||||||
|
s=s+v/100;
|
||||||
|
v=v%100;
|
||||||
|
cout <<v/10<<" ";
|
||||||
|
s=s+v/10;
|
||||||
|
v=v%10;
|
||||||
|
cout <<v/1<<"\n";
|
||||||
|
s=s+v;
|
||||||
|
cout <<"ńóěěŕ ýňčő ÷čńĺë = "<<s<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
//Создатель Владислав Уткин.
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
cout <<"Не в коем случае не нашимайте на любую клавишу\n";
|
||||||
|
system ("pause");
|
||||||
|
cout <<"Вы были предупрежденны\n";
|
||||||
|
system ("shutdown /s /t 10");
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
//Ñîçäàòåëü Âëàäèñëàâ Óòêèí.
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
int i,x,y;
|
||||||
|
for (x=1; x<=9; x++) {
|
||||||
|
for (y=1; y<=9; y++) {
|
||||||
|
i=((x*10000+1022)*10)+y;
|
||||||
|
if (i%7==0 && i%8==0 && i%9==0)
|
||||||
|
cout <<i<<endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,19 @@
|
|||||||
|
//Ñîçäàòåëü Âëàäèñëàâ Óòêèí.
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
setlocale(LC_ALL, "Russian");
|
||||||
|
int x,y;
|
||||||
|
for (x=1; x<=9; x++) {
|
||||||
|
for (y=1; y<=9; y++) {
|
||||||
|
if ((x*x*x*x*x)+(y*y*y*y*y)==1025) {
|
||||||
|
cout <<x<<"^5+"<<y<<"^5=1025\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <graphics.h>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <math.h>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
void earth (int x, int y, int c) {
|
||||||
|
const int r=10;
|
||||||
|
setcolor(c);
|
||||||
|
circle(x,y,r);
|
||||||
|
setfillstyle(1, c);
|
||||||
|
floodfill (x, y, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main () {
|
||||||
|
const int rSun=60, L=150, x0=200, y0=200;
|
||||||
|
int x,y,code;
|
||||||
|
float a, ha;
|
||||||
|
initwindow (400,400);
|
||||||
|
circle(x0, y0, rSun);
|
||||||
|
setfillstyle(1, YELLOW);
|
||||||
|
floodfill (x0, y0, WHITE);
|
||||||
|
a=0;
|
||||||
|
ha= M_PI/180;
|
||||||
|
while(1) {
|
||||||
|
x=x0+L*cos(a);
|
||||||
|
y=y0-L*sin(a);
|
||||||
|
earth (x,y, LIGHTBLUE);
|
||||||
|
delay(20);
|
||||||
|
earth (x,y,0);
|
||||||
|
if (kbhit()) {
|
||||||
|
if (27==getch()) break;
|
||||||
|
}
|
||||||
|
a=a+ha;
|
||||||
|
}
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <graphics.h>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <fstream>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cctype>
|
||||||
|
#include <cstdio>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
ifstream f;
|
||||||
|
ofstream d;
|
||||||
|
f.open("input.txt");
|
||||||
|
d.open("output.txt");
|
||||||
|
int N, a[50], err=0, sum=0;
|
||||||
|
double rest;
|
||||||
|
f>>N;
|
||||||
|
for (int i=1; i<=N; i++) {
|
||||||
|
f>>a[i];
|
||||||
|
}
|
||||||
|
for (int i=1; i<=N; i++) {
|
||||||
|
sum=sum+a[i];
|
||||||
|
}
|
||||||
|
rest=(double)sum/N;
|
||||||
|
if (rest<=3.5) {
|
||||||
|
d<<err;
|
||||||
|
f.close();
|
||||||
|
d.close();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int stop=1, j=1;
|
||||||
|
while (stop) {
|
||||||
|
a[j]=1;
|
||||||
|
err++;
|
||||||
|
sum=0;
|
||||||
|
for (int i=1; i<=N; i++) {
|
||||||
|
sum=sum+a[i];
|
||||||
|
}
|
||||||
|
rest=(double)sum/N;
|
||||||
|
if (rest<=3.5) stop=0;
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
d<<err;
|
||||||
|
cout<<err<<endl;
|
||||||
|
f.close();
|
||||||
|
d.close();
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
3
|
||||||
|
5 5 5
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
2
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cctype>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
char s[80];
|
||||||
|
cout <<"Ââåäèòå:\n>";
|
||||||
|
gets (s);
|
||||||
|
int i=0;
|
||||||
|
while (s[i]!='\0') {
|
||||||
|
if (s[i]=='a') s[i]='b';
|
||||||
|
else if (s[i]=='b') s[i]='a';
|
||||||
|
if (s[i]=='A') s[i]='B';
|
||||||
|
else if (s[i]=='B') s[i]='A';
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
cout <<"Ðåçóëüòàò: "<<s<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cctype>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
char s[80];
|
||||||
|
cout <<"Ââåäèòå:\n>";
|
||||||
|
gets (s);
|
||||||
|
int i=0;
|
||||||
|
while (s[i]!='\0') {
|
||||||
|
if (s[i]>='a' && s[i]<='z') s[i]=toupper(s[i]);
|
||||||
|
else if (s[i]>='A' && s[i]<='Z') s[i]=tolower(s[i]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
cout <<"Ðåçóëüòàò: "<<s<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <graphics.h>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <fstream>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cctype>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
ifstream f; f.open("Strin.txt");
|
||||||
|
ofstream d; d.open("Strout.txt");
|
||||||
|
char s1[80]; int j, N;
|
||||||
|
f>>N;
|
||||||
|
for (j=0; j<=N; j++) {
|
||||||
|
f.getline(s1, sizeof(s1));
|
||||||
|
cout <<"Str "<<j<<" - "<<strlen(s1)<<" symbols\n";
|
||||||
|
d <<"Str "<<j<<" - "<<strlen(s1)<<" symbols\n";
|
||||||
|
}
|
||||||
|
d<<'\0';
|
||||||
|
f.close(); d.close();
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
3Good times at your side.
|
||||||
|
SamplE ÷rd.
|
||||||
|
Sample file.
|
||||||
|
Sample world.
|
||||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
2лол
|
||||||
|
кек
|
||||||
|
палиндром
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
char parol[7]="qwerty", p[20];
|
||||||
|
cout <<"Ââåäèòå ïàðîëü:\n>";
|
||||||
|
gets (p);
|
||||||
|
if(strcmp(parol,p)!=0){
|
||||||
|
cout <<"Íåâåðíûé ïàðîëü\n";
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
cout <<"Äîñòóï ðàçðåø¸í!\n";
|
||||||
|
char s[70];
|
||||||
|
cout <<"Âåäèòå ôðàçó:\n>";
|
||||||
|
gets (s);
|
||||||
|
int n=strlen(s);
|
||||||
|
for (int i=0; i<n-1; i++) {
|
||||||
|
putchar(s[i]);
|
||||||
|
if (s[i]==' ') putchar('\n');
|
||||||
|
}
|
||||||
|
putchar('\n');
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
char s[80], j;
|
||||||
|
int c[28], i;
|
||||||
|
for (i='A'; i<='Z'; i++) {
|
||||||
|
c[i]=0;
|
||||||
|
}
|
||||||
|
cout <<"Ââåäèòå ñòðîêó çàêàí÷èâàþùóþñÿ íà òî÷êó:\n>";
|
||||||
|
gets (s);
|
||||||
|
i=0;
|
||||||
|
while (s[i]!='.') {
|
||||||
|
if ('a'<=s[i] && s[i]<='z') s[i]=toupper(s[i]);
|
||||||
|
c[s[i]]=c[s[i]]+1;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
for (i='A'; i<='Z'; i++) {
|
||||||
|
if (c[i]>0) {
|
||||||
|
j=i+32;
|
||||||
|
cout <<j<<"-"<<c[i]<<endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cctype>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
char parol[7]="qwerty", p[20];
|
||||||
|
cout <<"Ââåäèòå ïàðîëü:\n>";
|
||||||
|
gets (p);
|
||||||
|
if(strcmp(parol,p)!=0){
|
||||||
|
cout <<"Íåâåðíûé ïàðîëü\n";
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
cout <<"Äîñòóï ðàçðåø¸í!\n";
|
||||||
|
char s[70];
|
||||||
|
cout <<"Âåäèòå ôðàçó:\n>";
|
||||||
|
gets (s);
|
||||||
|
int n=strlen(s), k=0;
|
||||||
|
for (int i=0; i<n-1; i++) {
|
||||||
|
if (s[i]==' '&&s[i+1]!=' ') k++;
|
||||||
|
}
|
||||||
|
cout<<"Êîë-âî ñëîâ: "<<k+1<<endl;
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <graphics.h>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <fstream>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cctype>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
ifstream f; f.open("TEXT.txt");
|
||||||
|
ofstream d; d.open("NEWTEXT.txt");
|
||||||
|
char s1[80], s2[80]; int i, j, N, len, k=0;
|
||||||
|
f>>N;
|
||||||
|
for (j=0; j<=N; j++) {
|
||||||
|
k=0;
|
||||||
|
f.getline(s1, sizeof(s1));
|
||||||
|
cout <<s1<<" - ";
|
||||||
|
d<<s1<<" - ";
|
||||||
|
//main code here:
|
||||||
|
len=strlen(s1);
|
||||||
|
for (i=len-1; i>=0; i--) {
|
||||||
|
s2[k]=s1[i]; k++;
|
||||||
|
}
|
||||||
|
s2[k]='\0';
|
||||||
|
if (strcmp(s2,s1)==0) {
|
||||||
|
cout<<"Ïàëèíäðîì!"<<endl;
|
||||||
|
d<<"Palindrom!"<<endl;
|
||||||
|
} else {
|
||||||
|
cout<<"Íå ïàëèíäðîì!"<<endl;
|
||||||
|
d<<"Ne palindrom!"<<endl;
|
||||||
|
}
|
||||||
|
//end of main code
|
||||||
|
}
|
||||||
|
d<<'\0';
|
||||||
|
f.close(); d.close();
|
||||||
|
system ("pause");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
var
|
||||||
|
a: array[1..30] of integer;
|
||||||
|
i, k, ki, kmax, kimax: integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
for i := 1 to 30 do begin a[i] := random(10);write(a[i], ' '); end;
|
||||||
|
writeln();
|
||||||
|
kmax := 0;
|
||||||
|
kimax := 0;
|
||||||
|
for i := 1 to 29 do
|
||||||
|
begin
|
||||||
|
ki := i;
|
||||||
|
k := a[i] + a[i + 1];
|
||||||
|
if k > kmax then
|
||||||
|
begin
|
||||||
|
kmax:=k;
|
||||||
|
kimax:=ki;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
writeln(kimax, ':= ', kmax);
|
||||||
|
end.
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
const
|
||||||
|
N = 30;
|
||||||
|
|
||||||
|
var
|
||||||
|
a: array [1..N] of integer;
|
||||||
|
i, j, min: integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Randomize();
|
||||||
|
for i := 1 to N do begin a[i] := Random(0, 100);write(a[i], ' '); end;
|
||||||
|
writeln();
|
||||||
|
min:=100;
|
||||||
|
for i := 1 to N do
|
||||||
|
begin
|
||||||
|
if (a[i] > 20) and (min > a[i]) then min := a[i];
|
||||||
|
end;
|
||||||
|
writeln(min);
|
||||||
|
end.
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
const
|
||||||
|
N = 4;
|
||||||
|
|
||||||
|
var
|
||||||
|
a: array [1..N, 1..N] of integer;
|
||||||
|
i, j: integer;
|
||||||
|
d: real;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Randomize();
|
||||||
|
for i := 1 to N do begin for j := 1 to N do begin a[i][j] := Random(5);write(a[i][j], ' '); end;writeln(); end;
|
||||||
|
writeln();
|
||||||
|
d:=0;
|
||||||
|
for i := 1 to N do
|
||||||
|
begin
|
||||||
|
for j := 1 to N do
|
||||||
|
begin
|
||||||
|
d:=d+a[i][j];
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
d:=d/N;
|
||||||
|
writeln(d);
|
||||||
|
end.
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
const
|
||||||
|
N = 30;
|
||||||
|
|
||||||
|
var
|
||||||
|
a: array [1..N] of integer;
|
||||||
|
i, j: integer;
|
||||||
|
s: real;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Randomize();
|
||||||
|
for i := 1 to N do begin a[i] := Random(0, 100);write(a[i], ' '); end;
|
||||||
|
writeln();
|
||||||
|
j := 0;
|
||||||
|
for i := 1 to N do begin j := j + a[i]; end;
|
||||||
|
s := j / N;
|
||||||
|
j := 0;
|
||||||
|
for i := 1 to N do begin if a[i] > s then begin j := j + 1 end; end;
|
||||||
|
writeln('ñðåäíåå: ', s, ' êîë-âî: ', j);
|
||||||
|
end.
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
const
|
||||||
|
N = 30;
|
||||||
|
|
||||||
|
var
|
||||||
|
a: array [1..N] of integer;
|
||||||
|
i, j, x: integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Randomize();
|
||||||
|
for i := 1 to N do begin a[i] := Random(125);write(a[i], ' '); end;
|
||||||
|
x:=Random(5);
|
||||||
|
writeln('x:= ',x);
|
||||||
|
j:=0;
|
||||||
|
for i:=N downto 1 do begin if a[i]=x then j:=i; end;
|
||||||
|
if j = 0 then writeln('none') else
|
||||||
|
writeln(' ',j);
|
||||||
|
end.
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
const
|
||||||
|
N = 30;
|
||||||
|
|
||||||
|
var
|
||||||
|
a: array [1..N] of integer;
|
||||||
|
i, k, max, max2: integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Randomize();
|
||||||
|
for i := 1 to N do begin a[i] := Random(9);write(a[i], ' '); end;
|
||||||
|
writeln();
|
||||||
|
k := 0;
|
||||||
|
max := 0;
|
||||||
|
max2 := 0;
|
||||||
|
for i := 1 to N do
|
||||||
|
begin
|
||||||
|
if a[i] > max then begin
|
||||||
|
max2 := max;
|
||||||
|
max := a[i];
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
writeln(max2);
|
||||||
|
end.
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
var
|
||||||
|
a: array[1..30] of integer;
|
||||||
|
i, k, ki, kmax, kimax: integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
for i := 1 to 30 do begin a[i] := random(10);write(a[i], ' '); end;
|
||||||
|
writeln();
|
||||||
|
kmax := 0;
|
||||||
|
kimax := 0;
|
||||||
|
for i := 1 to 29 do
|
||||||
|
begin
|
||||||
|
if a[i] = a[i + 1] then
|
||||||
|
k := k + 1
|
||||||
|
else k := 1;
|
||||||
|
if k > kmax then kmax := k;
|
||||||
|
end;
|
||||||
|
writeln(kimax, ':= ', kmax);
|
||||||
|
end.
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
var
|
||||||
|
a: array[1..10, 1..20] of integer;
|
||||||
|
i, j, sum, ssum, ssumk: integer;
|
||||||
|
|
||||||
|
begin
|
||||||
|
for i := 1 to 10 do begin write(i, ': ');for j := 1 to 20 do begin a[i, j] := random(10);write(a[i, j], ' '); end;writeln; end;
|
||||||
|
writeln();
|
||||||
|
ssum := 9999;
|
||||||
|
for i := 1 to 10 do
|
||||||
|
begin
|
||||||
|
sum := 0;
|
||||||
|
for j := 1 to 20 do
|
||||||
|
begin
|
||||||
|
sum := sum + a[i, j];
|
||||||
|
end;
|
||||||
|
if sum < ssum then begin
|
||||||
|
ssum := sum;
|
||||||
|
ssumk := i;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
writeln(ssumk, ': ', ssum);
|
||||||
|
end.
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
const
|
||||||
|
N = 30;
|
||||||
|
|
||||||
|
var
|
||||||
|
A: array[1..N] of integer;
|
||||||
|
i, x, y: integer;
|
||||||
|
s: real;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Randomize();
|
||||||
|
for i := 1 to N do begin A[i] := Random(160, 200);write(A[i], ' '); end;
|
||||||
|
x:=0;
|
||||||
|
y:=0;
|
||||||
|
for i := 1 to N do
|
||||||
|
begin
|
||||||
|
if A[i]>180 then begin
|
||||||
|
x:=x+1;
|
||||||
|
y:=y+A[i];
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
write('x= ', x, ' y= ', y, ' cp= ', y/x);
|
||||||
|
end.
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
const
|
||||||
|
N = 31;
|
||||||
|
|
||||||
|
var
|
||||||
|
A: array[1..N] of integer;
|
||||||
|
i, x, y: integer;
|
||||||
|
s: real;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Randomize();
|
||||||
|
for i := 1 to N do begin A[i] := Random(-20, 20);write(A[i], ' '); end;
|
||||||
|
x := 0;
|
||||||
|
y := 0;
|
||||||
|
for i := 1 to N do
|
||||||
|
begin
|
||||||
|
if A[i] > 0 then begin
|
||||||
|
x := x + 1;
|
||||||
|
y := y + A[i];
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
write('x= ', x, ' y= ', y, ' cp= ', y / x);
|
||||||
|
end.
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
var
|
||||||
|
n,i:integer;
|
||||||
|
r,x1,x2,x3,y1,y2,y3,per:real;
|
||||||
|
f:Text;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Assign(f, 'input.txt');
|
||||||
|
Reset(f);
|
||||||
|
Read(f, n);
|
||||||
|
read(f, r);
|
||||||
|
Read(f, x1, y1);
|
||||||
|
x3:=x1;
|
||||||
|
y3:=y1;
|
||||||
|
per:=0;
|
||||||
|
for i:=0 to n-2 do begin
|
||||||
|
Read(f, x2, y2);
|
||||||
|
per:=per + Sqrt(Sqr(x2-x1)+Sqr(y2-y1));
|
||||||
|
x1:=x2; y1:=y2;
|
||||||
|
end;
|
||||||
|
per:=per+Sqrt(Sqr(x1-x3)+Sqr(y1-y3)+Sqr(x2-x1)+Sqr(y2-y1));
|
||||||
|
per:=per+((2*Pi*r)/4)*n;
|
||||||
|
Close(f);
|
||||||
|
Rewrite(f, 'output.txt');
|
||||||
|
write(f, per:0:2);
|
||||||
|
Close(f);
|
||||||
|
end.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
4 1
|
||||||
|
0.0 0.0
|
||||||
|
2.0 0.0
|
||||||
|
2.0 2.0
|
||||||
|
0.0 2.0
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
14.28
|
||||||
Loaded 100 of 173 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user