ياعسل لو لاحظتي انو شاشه الرن تختفي بسرعه اضفت داله getchar();
ونضيف فوق الانكلود حقها #include <stdio.h>
بس عشان تتوقف الرن هذا الكود بعد التعديل
كود:
#include <iostream>
#include <string>
#include <stdio.h>
int main()
{
cout << "Enter a 2 digit number: ";
string number;
cin >> number;
if( number.length() == 2)
{
cout << "The first digit is: " << number[0] << endl;
cout << "The second digit is: " << number[1] << endl;
}
else {
cout<<" error the number more than 2 digit"<<endl; }
getchar();
}