chineck ko hindi naglalabas ng exception error kahit maling input sa cin.
Try mo to. Baka makakuha ka ng idea.
Code:
#include<string>
#include<iostream>
using namespace std;
string strrev(string r){
int temp;
for(int i = 0,int j = r.size()-1 ; i <= j ; i++, j--)
{
temp = r[i];
r[i] = r[j];
r[j] = temp;
}
return r;
}
int main()
{
int digits;
string stringDigit;
cout<<"Enter any Integer for Reversing: ";
cin>> digits;
if(!cin)
{
cout<< "The input is not a digit, input should be single integer without spaces...\n\n";
}
else
{
stringDigit = to_string(digits);
cout<<"The Reversed of "<<stringDigit<<" is "<<strrev(stringDigit) << endl << endl;
}
}
chineck ko hindi naglalabas ng exception error kahit maling input sa cin.
Try mo to. Baka makakuha ka ng idea.
Code:
#include<string>
#include<iostream>
using namespace std;
string strrev(string r){
int temp;
for(int i = 0,int j = r.size()-1 ; i <= j ; i++, j--)
{
temp = r[i];
r[i] = r[j];
r[j] = temp;
}
return r;
}
int main()
{
int digits;
string stringDigit;
cout<<"Enter any Integer for Reversing: ";
cin>> digits;
if(!cin)
{
cout<< "The input is not a digit, input should be single integer without spaces...\n\n";
}
else
{
stringDigit = to_string(digits);
cout<<"The Reversed of "<<stringDigit<<" is "<<strrev(stringDigit) << endl << endl;
}
}
Pero gusto ko, may progress ka hindi yung sa akin ka magpapagawa. Tulad nito may gawa ka na, ganun tapos may nahihirapan kang part. I will be willing to help.
Pero gusto ko, may progress ka hindi yung sa akin ka magpapagawa. Tulad nito may gawa ka na, ganun tapos may nahihirapan kang part. I will be willing to help.
Pwede po bang mag declude ng dot(.) ?
balak ko din po kasing gamitin yung code nyo po na yan sa isa pang program na e^x na naka double variable po, hindi po kasi nya tinatanggap ang dot(.) kaya kahit mag enter ako ng 12.12 auto block syaa,
Pwede po bang mag declude ng dot(.) ?
balak ko din po kasing gamitin yung code nyo po na yan sa isa pang program na e^x na naka double variable po, hindi po kasi nya tinatanggap ang dot(.) kaya kahit mag enter ako ng 12.12 auto block syaa,