-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMerge.cpp
More file actions
40 lines (40 loc) · 759 Bytes
/
Merge.cpp
File metadata and controls
40 lines (40 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void)
{
for(int x=1;x<=228;x++)
{
char name1[10] = {0}, name2[10] = {0}, c = 'a';
int k, y = 0;
string num;
while(k!=0)
{
num.push_back(k%10+48);
k = (k-k%10)/10;
}
while(num.size())
{
name1[y++] = num.back();
name2[y-1] = num.back();
num.pop_back();
}
name1[y] = name2[y] = '.';
name1[y+1] = 'c';
name1[y+2] = 's';
name1[y+3] = 'v';
name2[y+1] = name2[y+3] = 't';
name2[y+2] = 'x';
FILE *fp1 = fopen(name1, "r"), *fp2 = fopen("input_NewBachFormat1.txt", "a+");
fprintf(fp2, "\n\n%d\n\n", x);
c = fgetc(fp1);
while(c!=EOF)
{
fprintf(fp2, "%c", c);
c = fgetc(fp1);
}
fclose(fp1);
fclose(fp2);
cout<<x<<endl;
}
}