Glenn's ACM code

什麼事都盡全力去做吧!!

2009年2月8日 星期日

Q483: Word Scramble

// Run time: 0.010
#include <stdio.h>
#include <string.h>
#define N 1000
char str[N];
int main()
{
int i;
int len;
while (true)
{
while (true)
{
if (scanf("%s", str) == EOF) return 0;

len = strlen(str);
for ( i = len-1; i >= 0; i--)
printf("%c", str[i]);

if (getchar() == '\n')
break;
putchar(' ');

}
printf("\n");

}
}
張貼者: Glenn Chen 於 凌晨1:36
標籤: ACM

沒有留言:

張貼留言

較新的文章 較舊的文章 首頁
訂閱: 張貼留言 (Atom)

Programming

  • 練習 (1)
  • ACM (65)

網誌存檔

  • ▼  2009 (66)
    • ►  05/03 - 05/10 (1)
    • ►  04/26 - 05/03 (1)
    • ►  03/29 - 04/05 (1)
    • ►  03/22 - 03/29 (1)
    • ►  03/08 - 03/15 (9)
    • ►  03/01 - 03/08 (6)
    • ►  02/22 - 03/01 (16)
    • ►  02/15 - 02/22 (7)
    • ▼  02/08 - 02/15 (19)
      • Q343: What Base Is This ?
      • Q679: Dropping Balls
      • Q686: Goldbach's Conjecture(II)
      • Q661: Blowing Fuses
      • Q612: DNA Sorting
      • Q587: There's treasure everywhere!
      • Q576: Hiaku Review
      • Q573: The Snail
      • Q568: Just the Facts
      • Q555: Bridge Hands
      • Q543: Goldbach's Conjecture
      • Q530: Binomial Showdown
      • Q516: Prime Land
      • Q498: Polly the Polynomial
      • Q492: Pig-Latin
      • Q490: Rotating Sentences
      • Q484:The Department of Redundancy Department
      • Q483: Word Scramble
      • Q482: Permutation Arrays
    • ►  02/01 - 02/08 (5)

連結

  • Algorithm Design Paradigms
  • 良葛格學習筆記
  • C++ Algorithms [C++ Reference]
  • A Tutorial on Dynamic Programming
  • UVa Online Judge
  • Lucky 貓的 ACM 園地
  • 美麗 C 世界
  • UVA toolkit
頂尖企業主題. 技術提供:Blogger.