anhquan

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
623 B
1
Indexable
Never
#include <iostream>
#include <math.h>
#include <iomanip>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    
    char c1, c2; int x;
    cin >> c1 >> c2 >> x;

    cout << "Ma ASCII cua ky tu \'" << c1 << "\', \'" << c2 << "\' lan luot la " << int(c1) << " va " << int(c2) << endl;
    cout << "Khoang cach giua hai ky tu \'" << c1 << "\', \'" << c2 << "\' la " << abs(c1 - c2) << endl;
    cout << "Dang viet hoa cua ky tu \'" << c1 << "\' la \'" << char(c1 - 32) << "\'" << endl;
    cout << x << " la ma ASCII cua ky tu \'" << char(x) << "\'" << endl;
    
    return 0;
}