鱼C论坛

 找回密码
 立即注册
查看: 4677|回复: 2

mod怎么用

[复制链接]
发表于 2012-10-1 17:11:26 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
#include<stdio.h>
#include<math.h>
void main()
{int n,t;
for(n=1;n<=10;n++)
{t=n mod 3;
printf("%d\t",t);
}
}
mod是这样用的吗?
出现error:
C:\Windows\System32\mod.cpp(7) : error C2146: syntax error : missing ';' before identifier 'mod'
C:\Windows\System32\mod.cpp(7) : error C2065: 'mod' : undeclared identifier
C:\Windows\System32\mod.cpp(7) : error C2143: syntax error : missing ';' before 'constant'
执行 cl.exe 时出错.

mod.exe - 1 error(s), 0 warning(s)
求指导
小甲鱼最新课程 -> https://ilovefishc.com
发表于 2012-10-1 18:51:52 | 显示全部楼层
你写的这程序是做什么?
小甲鱼最新课程 -> https://ilovefishc.com
发表于 2012-10-1 21:26:18 | 显示全部楼层
c++中好像没有mod这个函数,求余的直接%么
mod好像在MATLAB中有
小甲鱼最新课程 -> https://ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-11-15 08:27

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表