Дамп всех задач

This commit is contained in:
vlad committed 2017-05-22 13:29:43 +03:00
1 parent b970626fef
commit 93746b05d7
173 files changed
+2505

No files matched your search

+23
View File
@@ -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;
}
+21
View File
@@ -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;
}
+25
View File
@@ -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;
}
+4
View File
@@ -0,0 +1,4 @@
3Good times at your side.
SamplE ÷rd.
Sample file.
Sample world.
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
2лол
кек
палиндром
+29
View File
@@ -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;
}
+30
View File
@@ -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;
}
+28
View File
@@ -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;
}
+40
View File
@@ -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;
}