通过海量题库、编程比赛和实时排名,系统化提升您的编程能力。
有如下程序:
#include<iostream> using namespace std; int main() { char str[100],*p; cout<<"please input a string:"; cin>>str; p=str; for(int i=0;*p!='\0';p++,i++); cout<<<i<<endl; return 0; }
运行这个程序,若输入字符串为:abcdefg abcd
则输出结果是()。