- Joined
- Jul 13, 2016
- Posts
- 30,492
- Solutions
- 10,610
- Reaction
- 20,280
- Points
- 17,722
- Age
- 24
Mga Master konting tulong naman po,
May way po ba para hindi i accept ng int variable ang mga special characters?
eto po yung code:
eto po yung output,
May way po ba para hindi i accept ng int variable ang mga special characters?
eto po yung code:
Code:
string strrev(string reverse){
int i,j;
j = reverse.size() - 1;
for( i = 0 ; i < j ; i++, j--){
temp = reverse[i];
reverse[i] = reverse[j];
reverse[j] = temp;
}
return reverse;
int main(){
string digits;
int TOOINT;
cout<<"Enter any Integer for Reversing: ";
cin.ignore();
do {
getline(cin, digits);
TOOINT = atoi(digits.c_str());
}while((TOOINT / 10) < 2);
cout<<"The Reversed of "<<digits<<" is "<<strrev(digits);
}
eto po yung output,
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.