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

This commit is contained in:
2017-05-22 13:29:43 +03:00
parent b970626fef
commit 93746b05d7
173 changed files with 2505 additions and 0 deletions

BIN
olymp2016/2/NEWTEXT.txt Normal file

Binary file not shown.

1
olymp2016/2/TEXT.txt Normal file
View File

@@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD>

39
olymp2016/2/polindrom.cpp Normal file
View File

@@ -0,0 +1,39 @@
#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<<"Palindrom!"<<endl;
d<<"Palindrom!"<<endl;
} else {
cout<<"Ne palindrom!"<<endl;
d<<"Ne palindrom!"<<endl;
}
//end of main code
}
d<<'\0';
f.close(); d.close();
return 0;
}