输入一个正整数,判断是否质数。用Pascal

[复制链接]
查看11 | 回复2 | 2010-5-2 15:14:09 | 显示全部楼层 |阅读模式
a ,i,b,c : real;这里有问题实数是不能作为For循环的变量的把real改为integer就好了我刚学的时候也经常犯这个错误
回复

使用道具 举报

千问 | 2010-5-2 15:14:09 | 显示全部楼层
var n,i:longint;b:boolean;beginreadln(n);if odd(n) then
begin
b:=false;i:=1;
while (20) then b:=true;
if b then writeln('Yes') else writeln('No');
end;end.请大家参考。(编程初学者)
回复

使用道具 举报

千问 | 2010-5-2 15:14:09 | 显示全部楼层
var n,i:longint;b:boolean;beginreadln(n);if odd(n) then
begin
b:=false;i:=1;
while (20) then b:=true;
if b then writeln('Yes') else writeln('No');
end;end.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行