C程序:
chardata[12]={"H”,"e","l","l","o",",","w","o","r","l","d","!“};
charpdata[12];
for(inti=0;i<11;i++)
{
if((data[i]>='A'&&data[i]<='Z')||(data[i]>='a'&&data[i]<='z'))
//該字符是字母則加4
pdata[i]=data[i]+4;
else
//該字符是標點符號或者\n或者其它
pdata[i]=data[i];
}
puts(pdata);