出于某种原因,我的 printf 和 scanf 显然未声明。我认为这与我不太了解的功能有关。
#include<stdlib.h>
#include<stdlib.h>
#include<ctype.h>
void testCount ();
int eleven = 11;
int input = 0;
int output = 0;
int count = 0;
int main (){
printf("What number would you like to count to?");
scanf("%d", &count);
testCount();
system("pause");
return 0;
}
void testCount (int x){
int y;
for(y=1;y<count;y++){
if (x < 10){
x + 1;
}
}
output = input/eleven;
}
最佳答案
您需要#include <stdio.h>
解决问题 printf()
和scanf()
。您有#include <stdlib.h>
两次。
此外,您应该更改:
void testCount ();
至:
void testCount (int x);
按照@Keine Lust 的建议。请不要忘记将值传递给新创建的 testCount()
功能!
关于c - 简单的计数程序问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40102769/