首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

hdu2016—— 数据的互换输出

2013-03-06 
hdu2016—— 数据的交换输出原题: #include stdio.hint main(){int i, n, m, b, cwhile (scanf(%d%d, &

hdu2016—— 数据的交换输出

原题:

 

#include <stdio.h>int main(){ int i, n, m, b, c; while (scanf("%d%d", &n, &m) != EOF) { b = 2; c = 0; for (i = 0 ; i < n / m ; i++) { printf(c++ ? " %d" : "%d", b + m - 1); b += m * 2; } printf(n % m ? " %d\n" : "\n", b + n % m - 1); } return 0;}


 

热点排行