第1个回答 2018-05-07
#include<stdio.h>
void main()
{
int n;
char str[100];
scanf("%s%n",str,&n);//注意%n不是%d,因此只需输入字符串即可得到n的值
printf("%s,字符串长度n=%d",str,n);
}
第2个回答 2011-04-25
Private Sub Command1_Click()
tmp = InputBox("请输入字符串", , "")
c = Len(tmp)
dx = 0
For i = 1 To c
If Mid(tmp, i, 1) >= "A" And Mid(tmp, i, 1) <= "Z" Then
dx = dx + 1
End If
Next
MsgBox "大写字母个数:" & dx
End Sub
第3个回答 推荐于2016-11-05
#include<stdio.h>
main()
{
char s;int i;
scanf("%c",s);
while
[s!='\n';i++;i=0;]
printf("%d",i);
}本回答被网友采纳