CPP
cpp
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
#include <iostream>
#include<cctype>
using namespace std;
int main() {string s;int a,b,i,d,ds,ys;
getline(cin,s);
d=s.size();
if(isalpha(s[0])>0){
for(i=0;i<10;i++){
if(isalpha(s[i])>0){
a++;
}}
switch(a){
case 3:b=5;break;
case 4:if(s[3]=='y'){b=7;}else{b=6;};break;
case 5:if(s[4]=='h'){b=3;}else{b=4;}break;
case 6:b=8;break;
case 7:if(s[6]=='y'){b=1;}else{b=10;}break;
case 8:if(s[2]=='b'){b=2;}else if(s[2]=='v'){b=11;}else{b=12;}break;
case 9:b=9;break;
}
for(i=a+1;isdigit(s[i])==1;i++){cout<<s[i];}
cout<<'/';
cout<<b;
cout<<'/';
for(i=d-4;i<d;i++){cout<<s[i];}
}
else{
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run