注册 登录
编程论坛 C语言论坛

新手,求各位大佬解答,哪里出问题了?

新袁 发布于 2023-11-09 16:22, 728 次点击
#include<stdio.h>
#include<stdlib.h>
int main(){
    int x=0,y=0,v=0;
    scanf("%d%d",&x,&y);
    v=sum(x,y);
    printf("%d",v);
    system("pause");
    return 0;
}
int sum(int a,int b)
{
    int x=0;
    x=a+b;
return x;
}
3 回复
#2
新袁2023-11-09 16:41
回复 楼主 新袁
#include<stdio.h>
#include<stdlib.h>
int main()
{
    int s,i=0;
    for(s=101;s<=200;s++)
    {
        if(sushu(s))
            i++;
    }
    print("%d",i);
    system("pause");
    return 0;
}
int sushu(int n)
{int k;
int ret=1;
    for(k=2;k<n;k++)
        if(n%k==0)
            ret=0;
            break;
    return ret;
}
还有这个,想不出来哪错了,头要秃了
#3
nosnoy2023-11-09 17:32
没有声明函数
#4
新袁2023-11-09 20:40
回复 3楼 nosnoy
感谢
1