x ,t,d,r,.y,y,a,n.w ,s,b,d,y,f,q,.d.b,q/w.d.a.是什么意思

来源:百度知道 编辑:UC知道 时间:2024/06/14 10:49:09
谁帮我翻译以下啊?
是拼音的第一个字吗??

这个并没有难度啊,就是ASCII码的计算而已。
#include <iostream>
using namespace std;
int main()
{
char* p = new char[30]();
gets(p);
int sum = 0;
for(int i = 0; i < strlen(p); i++)
{
if(p[i] >= 'A' && p[i] <= 'Z')
{
sum += p[i]-'A'+1;
}
else if(p[i] >= 'a' && p[i] <= 'z')
{
sum += p[i]-'a'+1;
}

}
cout<<sum<<"%"<<endl;
delete[] p;
return 0;
} #include<iostream>
#include<string.h>
using namespace std;
main ()
{
int b=0;
char a[1000];
cin>>a;
for (int i=0;i<strlen (a);i++)
{
if (a[i]>='a' && a[i]<='z')
b+=(a[i]-'a')+1;
if (a[i]>='A' && a[i]<='Z')
b+=(a[i]-'A')+1;
}
cout<