Изменить порядок символов в строке S1 на обратный не используя других строк. Код программы:
#include "stdafx.h" #include <iostream> #include <string.h> using namespace std; void main () { char S1[30], temp; int i; cout<<"Input String S1:\n"; cin>>S1; cout<<"\nThe Result: \n\n"<<strrev(s1)<<"\n\n";>; S1=S1[strlen(S1)-i]; S1[strlen(S1)-i]=temp; } } Что делает эта часть программы: for(i=0;i<strlen(s1)/2;i++)>; S1=S1[strlen(S1)-i]; S1[strlen(S1)-i]=temp; } Почему в i
Код программы:
#include "stdafx.h"
#include <iostream>
#include <string.h>
using namespace std;
void main () {
char S1[30], temp;
int i;
cout<<"Input String S1:\n";
cin>>S1;
cout<<"\nThe Result: \n\n"<<strrev(s1)<<"\n\n";>;
S1=S1[strlen(S1)-i];
S1[strlen(S1)-i]=temp;
}
}
Что делает эта часть программы:
for(i=0;i<strlen(s1)/2;i++)>;
S1=S1[strlen(S1)-i];
S1[strlen(S1)-i]=temp;
}
Почему в i