/*
2020/4/17
第二遍
*/
#include <iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
char str[10000];
void fun(char temp[],int len,int &count)
{
int i = 0;
for(i = 0;i<len;i++)
{
if(temp[i] == '=')
{
break;
}
}
if(i == len)
printf("%s%d\n",temp,count++);
else
{
int sum = 0;
int j = 0;
for(j = i+1;j<len;j++)
{
sum = sum*10 + temp[j]-'0';
}
count = sum;
for(j = 0;j<i;j++)
{
printf("%c",temp[j]);
}
printf("%d\n",count++);
}
}
int main()
{
int i,j;
char temp[50];
int ci = 0;
int count = 0;
gets(str);
int len = strlen(str);
for(i = 0;i<len;)
{
if(str[i] == '}') break;
while(str[i]!='{' && str[i]!=',')
{
i++;
}
ci = 0;
for(j = i+1;j<len;j++)
{
if(str[j]!=','&& str[j]!='}')
{
temp[ci++] = str[j];
}
else
{
temp[ci] = '\0';
fun(temp,ci,count);
i = j;
break;
}
}
}
return 0;
}
/*
enum BOOL{true,false};
true0
false1
enum date{JAN=1,FEB,MAR,APR,MAY,JUN,JULY,AUG,SEP,OCT,NOV,DEC,MON=1,TUE,WED,THU,FRI,SAT,SUN,found=1949};
JAN1
FEB2
MAR3
APR4
MAY5
JUN6
JULY7
AUG8
SEP9
OCT10
NOV11
DEC12
MON1
TUE2
WED3
THU4
FRI5
SAT6
SUN7
found1949
*/
2016-2
最新推荐文章于 2021-06-01 14:29:03 发布