将C语言转成流程图

输入一个年份xxxx(四位数字),按顺序输出该年之后接下来的8个闰年,输出格式为:
The eight leap years following xxxx are:year1,year2,……,year8.
注: xxxx显示为所输入的年份,year1~ year8分别显示为8个闰年年份(四位数字)。#include<iostream>

using namespace std;

int main(){
int i,n;
int count=0;
cin >> n;
for(i=n+1;;i++){
if(i%4==0 && i%100!=0 || i%400==0){
count++;
cout <<i;
if(count<=7)cout << ",";
}
if(count==8)break;
}
return 0;
}
急急急

//c程序
#include"stdio.h"
#include "ctype.h"
void main(void)
{int i,cnt=0;
int nyear,myear;
int oyear[8];
scanf("输入一个年份:%d",&nyear);
myear=nyear;
for(i=1;i<100;i++)
{myear+=i;
if((myear&0x3)==0)oyear[cnt++]=myear;
if(cnt==8)break;
}
printf(" The eight leap years following %d are:%d,%d,%d,%d,%d,%d,%d,%d",nyear,oyear[0],oyear[1],oyear[2],oyear[3],oyear[4],oyear[5],oyear[6],oyear[7]);
}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-12-07

追问

这么简单的么

这么简单的么

追答

流程图写出过程就好了,实现了什么,进行了什么活动,有哪些判断,我是这么想的

相似回答