• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
DementRock
   首页          管理     

Sgu 404

又是水题,做个取余就行了

sgu 404
 1 #include<stdio.h>
 2 #include<stdlib.h>
 3 #include<string.h>
 4 int main()
 5 {
 6     int a,b;
 7     char s[1000],tmp[1000];
 8     scanf("%d %d\n",&a,&b);
 9     a%=b;
10     a=(!a)?b:a;
11     for(int i=1;i<=b;++i)
12     {
13          fgets(s,1000,stdin);
14          if(i==a)
15              strcpy(tmp,s);
16     }
17     printf("%s",tmp);
18     return 0;
19 }


 

posted @ 2010-02-15 20:56  DementRock  阅读(129)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3