#include<iostream>
using namespace std;
void main()
{
char a[20],b[20],n1,n2,i;
char s;
cout<<"第一个字符串: ";
cin>>a;
cout<<"第二个字符串:";
cin>>b;
for(i=0;a[i]!=0;i++)
n1=i;
for(i=0;b[i]!=0;i++)
n2=i;
if(n1>n2)
cout<<"较长字符是:"<<a<<endl;
else
cout<<"较长字符是:"<<b<<endl;
s=n1-n2;
cout<<"查询字符ASCII码 -> 输入字符: ";
cout<<s<<"的ASCII码为: "<<(int)s<<endl;
system("pause");
}