code 写好了,太晚了,睡觉了,不写注释了啊
- #include <stdio.h>
- int main()
- {
- char str [200];
- printf ("Insert your function: ");
- gets (str);
- int i,j,k;
- int num = 0;
-
- printf("Name der Funktion:");
- i = 0;
- while ( str[i]!='(' ){
- printf("%c",str[i]);
- i++;
- }
- printf("\n");
-
- j = 0;
- while ( str[i]=='(' )i++;
- while ( str[i]!=')' ){
- j++;
- printf("%d.Parameter:", j);
- while ( str[i]!=',' && str[i]!=')' ){
- if(str[i]!=' ')printf("%c",str[i]);
- i++;
- }
- printf("\n");
- while ( str[i]==',' )i++;
- }
-
- printf("Zahl der Parameter: %d\n",j);
-
- return 0;
- }
复制代码 |