青青草国产精品久久,99久久成人国产精品免费,精品乱码久久久久久夜夜嗨http://www.shnenglu.com/MiYu/category/14416.html ______________白白の屋zh-cnThu, 28 Oct 2010 22:28:13 GMTThu, 28 Oct 2010 22:28:13 GMT60HDU 3082 HDOJ 3082 Simplify The Circuit ACM 3082 IN HDUhttp://www.shnenglu.com/MiYu/archive/2010/10/28/131671.htmlMiYuMiYuThu, 28 Oct 2010 14:23:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/10/28/131671.htmlhttp://www.shnenglu.com/MiYu/comments/131671.htmlhttp://www.shnenglu.com/MiYu/archive/2010/10/28/131671.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/131671.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/131671.html

 

MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋            

 

題目地址 :

http://acm.hdu.edu.cn/showproblem.php?pid=3082

題目分析:

     沒什么特殊的方法, 簡單模擬就可以了  :

 代碼 :

代碼
/*
Mail to   : miyubai@gamil.com
My Blog   : www.baiyun.me
Link      : 
http://www.cnblogs.com/MiYu  || http://www.shnenglu.com/MiYu
Author By : MiYu
Test      : 1
Complier  : g++ mingw32-3.4.2
Program   : HDU_3082
Doc Name  : Simplify The Circuit
*/
//#pragma warning( disable:4789 )
#include <iostream>
#include 
<fstream>
#include 
<sstream>
#include 
<algorithm>
#include 
<string>
#include 
<set>
#include 
<map>
#include 
<utility>
#include 
<queue>
#include 
<stack>
#include 
<list>
#include 
<vector>
#include 
<cstdio>
#include 
<cstdlib>
#include 
<cstring>
#include 
<cmath>
#include 
<ctime>
using namespace std;
char str[110];
char *tok;
int main ()
{
    
int T;
    scanf ( 
"%d",&T );
    
while ( T -- ) {
        
int N;
        
double res = 0;
        scanf ( 
"%d"&N );
        
for ( int i = 1; i <= N; ++ i ) {
            scanf ( 
"%s", str );
            tok 
= strtok ( str, "-" );
            
int t = atoi ( tok );
            
int r = t;
            
while ( tok = strtok ( NULL, "-" ) ) {
                t 
= atoi ( tok );
                r 
+= t;
            }
            res 
+= 1.0 / r;
        }
        printf ( 
"%.2lf\n"1.0 / res );
    }
    
return 0;
}

 



MiYu 2010-10-28 22:23 發表評論
]]>
HDU 1230 HDOJ 1230 火星A+B ACM 1230 IN HDU http://www.shnenglu.com/MiYu/archive/2010/10/28/131654.htmlMiYuMiYuThu, 28 Oct 2010 11:46:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/10/28/131654.htmlhttp://www.shnenglu.com/MiYu/comments/131654.htmlhttp://www.shnenglu.com/MiYu/archive/2010/10/28/131654.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/131654.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/131654.html

MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋    

 

 題目地址:

        http://acm.hdu.edu.cn/showproblem.php?pid=1230

題目描述:

      純粹的模擬題........

代碼:

 代碼

#include <iostream>
#include 
<string>
#include 
<algorithm>
#include 
<cstdlib>
#include 
<cstdio>
#include 
<cstring>
using namespace std;
string a, b;
int prim[40= {1,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113};
int x[30], y[30];
int main () {
    
while ( cin >> a >> b, a != "0" && b != "0" ) {
        memset ( x, 
0sizeof(x) );
        memset ( y, 
0sizeof(y) );
        
int j = 1, k = 1;
        
for ( int i = 0; i < a.size(); ++ i ) {
            
if ( a[i] != ',' ) {
                x[j] 
= x[j] * 10 + a[i] - '0';
            } 
else {
                 
++ j;
            }
        }
        
for ( int i = 0; i < b.size(); ++ i ) {
            
if ( b[i] != ',' ) {
                y[k] 
= y[k] * 10 + b[i] - '0';
            } 
else {
                
++ k;
            }
        }
        reverse ( x
+1, x + j + 1 );
        reverse ( y
+1, y + k + 1 );
        
int f = 0;
        
int m = j;
        
int mm = k;
        
int t = 0;
        
if ( m > mm ) {
            swap ( m, mm );
            t 
= 1;
        }
        
//cout << m << " " << mm << endl;
        int z[30];
        
for ( int i = 1; i <= m; ++ i ) {
            z[i] 
= x[i] + y[i] + f;
            f 
= z[i] / prim[i];
            z[i] 
%= prim[i];
        }
        z[m
+1= 0;
        
for ( int i = m + 1; i <= mm; ++ i ) {
            
int temp = 0;
            
if ( !t ) temp = y[i];
            
else temp = x[i];
            z[i] 
= temp + f;
            f 
= z[i] / prim[i];
            z[i] 
%= prim[i];
        }
        
if ( f ) {
            z[
++mm] = f;
        }
        
for ( int i = mm; i > 0-- i ) {
            printf ( i 
== mm ? "%d" : ",%d",z[i] );
        }
        putchar ( 
10 );
    }
    
return 0;
}


MiYu 2010-10-28 19:46 發表評論
]]>
HDOJ 2526 HDU 2526 浪漫手機 ACM 2526 IN HDUhttp://www.shnenglu.com/MiYu/archive/2010/09/26/127770.htmlMiYuMiYuSun, 26 Sep 2010 08:42:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/09/26/127770.htmlhttp://www.shnenglu.com/MiYu/comments/127770.htmlhttp://www.shnenglu.com/MiYu/archive/2010/09/26/127770.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/127770.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/127770.htmlMiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋    

 

題目地址:

http://acm.hdu.edu.cn/showproblem.php?pid=2526

題目描述:

浪漫手機

Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 362    Accepted Submission(s): 150


Problem Description
最近,WisKey迷上了手機鈴聲,但是他對音律不是很懂,所以他想著能否用計算機來隨機生成鈴聲。當WisKey寫好程序后,發現生成出來的根本不是鈴聲,而是噪聲!
之后WisKey查閱了一些樂譜發現,其實很多鈴聲是以某種規律變化的,這里為了簡化這個難題,他以連續3個音符來判斷下個音符。
如有模式

在給定第一行樂譜的情況下,按模式將產生如下樂譜圖形:

我們用0表示白色格子,用1表示黑色格子。
對于沒有連續3個格子的邊緣(即沒有左邊格子或右邊格子),我們直接用白色格子代替缺少的那一個格子。
 

Input
第一行有一個整數T,代表有T組數據。
每組數據有一個整數M,表示要輸出M行樂譜。接著有8行模式串,左邊是音符模式,右邊是下一個音符。最后一行是第一行樂譜。
 

Output
輸出M行,表示M行樂譜。
 

Sample Input
1 16 111 1 110 1 101 1 100 1 011 1 010 0 001 1 000 0 0000000000000001000000000000000
 

Sample Output
0000000000000001000000000000000 0000000000000010100000000000000 0000000000000101010000000000000 0000000000001010101000000000000 0000000000010101010100000000000 0000000000101010101010000000000 0000000001010101010101000000000 0000000010101010101010100000000 0000000101010101010101010000000 0000001010101010101010101000000 0000010101010101010101010100000 0000101010101010101010101010000 0001010101010101010101010101000 0010101010101010101010101010100 0101010101010101010101010101010 1010101010101010101010101010101
 

 

題目分析 :

純水 模擬題..........      就是 由 上面 3 個 格子的 顏色 推出下面 中間那塊的 顏色.  推出來直接輸出就可以了 .

  題目開始已經給出了第一行的 顏色 , 下面的可以直接 暴力推出來  用hash很快就能判斷.

代碼如下 :

 /*

Coded By  : MiYu

Link      : http://www.cnblogs.com/MiYu  || http://www.shnenglu.com/MiYu

Author By : MiYu

Test      : 1

Program   : 2526

*/

//#pragma warning( disable:4789 )

#include <iostream>

#include <cstdio>

#include <cstring>

using namespace std;

char c[2][50];

int T,t,M;

int main(){

    char a[3],b[9];

for(int i=0;i<2;i++) c[i][0]='0';

scanf("%d",&T);

while(T--){

scanf("%d",&M);

for(int i=1;i<=8;i++){

scanf("%s",a);

int num=(a[0]-'0')*4+(a[1]-'0')*2+a[2]-'0';

scanf("%d",&t);

b[num] = '0' + t;

}

scanf("%s",&c[0][1]);

int len=strlen(&c[0][1]);

for(int i=0;i<2;i++) c[i][len+1]='0';

for(int j=0;j<M;j++){

for(int i=0;i<len;i++){

int num=(c[j%2][i]-'0')*4+(c[j%2][i+1]-'0')*2+c[j%2][i+2]-'0';

c[(j+1)%2][i+1]=b[num];

                printf("%c",c[j%2][i+1]);

}

            printf("\n");

}

}

return 0;

}


 



MiYu 2010-09-26 16:42 發表評論
]]>
HDOJ HDU 1008 Elevator ACM 1008 IN HDU http://www.shnenglu.com/MiYu/archive/2010/08/08/122705.htmlMiYuMiYuSun, 08 Aug 2010 14:21:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/08/122705.htmlhttp://www.shnenglu.com/MiYu/comments/122705.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/08/122705.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/122705.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/122705.htmlMiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

題目地址:
         http://acm.hdu.edu.cn/showproblem.php?pid=1008
題目描述:
Problem Description
The highest building 
in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to move down one floor. The elevator will stay for 5 seconds at each stop.

For a given request list, you are to compute the total time spent to fulfill the requests on the list. The elevator 
is on the 0th floor at the beginning and does not have to return to the ground floor when the requests are fulfilled.
 

Input
There are multiple test cases. Each 
case contains a positive integer N, followed by N positive numbers. All the numbers in the input are less than 100. A test case with N = 0 denotes the end of input. This test case is not to be processed.
 

Output
Print the total time on a single line 
for each test case
 

Sample Input
1 2
3 2 3 1
0

又是一個水到極點的模擬............
直接代碼:
#include <iostream>
using namespace std;
int main ()
{
    
int T;
    
while ( cin >> T , T )
    {
            
int beg = 0 , stop = 0, sum = 0;
            
for ( int i = 1; i <= T; ++ i )
            {
                  cin 
>> stop;
                  
if ( stop > beg )
                  {
                       sum 
+= ( stop - beg ) * 6 + 5;
                  } 
                  
else
                  {
                       sum 
+= ( beg - stop ) * 4 + 5
                  }
                  beg 
= stop;
            } 
            cout 
<< sum << endl;
    }
    
return 0



MiYu 2010-08-08 22:21 發表評論
]]>
HDOJ HDU 1228 A + B ACM 1228 IN HDU http://www.shnenglu.com/MiYu/archive/2010/08/08/122704.htmlMiYuMiYuSun, 08 Aug 2010 14:18:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/08/122704.htmlhttp://www.shnenglu.com/MiYu/comments/122704.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/08/122704.html#Feedback4http://www.shnenglu.com/MiYu/comments/commentRss/122704.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/122704.htmlMiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋


題目地址:
         http://acm.hdu.edu.cn/showproblem.php?pid=1228
題目描述:
Problem Description
讀入兩個小于100的正整數A和B,計算A
+B.
需要注意的是:A和B的每一位數字由對應的英文單詞給出.
 

Input
測試輸入包含若干測試用例,每個測試用例占一行,格式為
"A + B =",相鄰兩字符串有一個空格間隔.當A和B同時為0時輸入結束,相應的結果不要輸出. 
 

Output
對每個測試用例輸出1行,即A
+B的值.
 

Sample Input
one 
+ two =
three four 
+ five six =
zero seven 
+ eight nine =
zero 
+ zero =
 

Sample Output
3
90
96

簡單的模擬題, 沒什么技巧
代碼如下:
MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

#include 
<iostream>
#include 
<map>
using namespace std;
map 
< stringint > mp;
void setMap ()
{
     mp[
"one"= 1; mp["two"= 2; mp["three"= 3
     mp[
"four"= 4; mp["five"= 5; mp["six"= 6
     mp[
"seven"= 7; mp["eight"= 8; mp["nine"= 9
     mp[
"zero"= 0;  
}
int main ()
{
    setMap ();
    
string a , b, c;
    
while ( cin >> a )
    {
            cin 
>> b;
            
int sum1 = mp[a];
            
while ( b != "+" )
            {
                    sum1 
= sum1 * 10 + mp[b];
                    cin 
>> b;
            }
            cin 
>> b;
            
int sum2 = mp[b];
            cin 
>> b;
            
while ( b != "=" )
            {
                    sum2 
= sum2 * 10 + mp[b];
                    cin 
>> b;
            }
            
if ( sum1 + sum2  == 0 )
            {
                 
break
            }
            cout 
<< sum1 + sum2 << endl;
    }
    
return 0



MiYu 2010-08-08 22:18 發表評論
]]>
HDOJ HDU 1032 The 3n + 1 problem ACM 1032 IN HDU http://www.shnenglu.com/MiYu/archive/2010/08/08/122692.htmlMiYuMiYuSun, 08 Aug 2010 12:31:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/08/122692.htmlhttp://www.shnenglu.com/MiYu/comments/122692.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/08/122692.html#Feedback1http://www.shnenglu.com/MiYu/comments/commentRss/122692.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/122692.htmlMiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

題目地址:
         http://acm.hdu.edu.cn/showproblem.php?pid=1032

水題,不解釋..........................

MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

#include
<stdio.h>
int Length(int n)
{
     
int k=0;
     
while(n!=1)
     {
           
if(n%2==1)
                 n
=3*n+1;
           
else
                 n
/=2;
           k
++;
     }
     
return (k+1);
}
int main( )
{
     
int i,j,temp,max,t,small,large; 
     
while(scanf("%d",&i)!=EOF) 
     {
           scanf(
"%d",&j);
           
if(i<=j)
           {
            small
=i;large=j;
           }
           
else { 
                 small
=j;large=i;
                 }   
           temp
=small;
           max
=Length(temp);
           
while(temp<=large)
           {
                 t
=Length(temp);
                 
if(t>max)
                       max
=t;
                 temp
++;
           }
           printf(
"%d %d %d\n",i,j,max);
     }
     
return 0;
}


MiYu 2010-08-08 20:31 發表評論
]]>
HDOJ HDU 2053 Switch Game ACM 2053 IN HDU http://www.shnenglu.com/MiYu/archive/2010/08/07/122528.htmlMiYuMiYuSat, 07 Aug 2010 07:20:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/07/122528.htmlhttp://www.shnenglu.com/MiYu/comments/122528.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/07/122528.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/122528.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/122528.html______________白白の屋

題目地址:
         http://acm.hdu.edu.cn/showproblem.php?pid=2053
題目描述:
Problem Description
There are many lamps 
in a line. All of them are off at first. A series of operations are carried out on these lamps. On the i-th operation, the lamps whose numbers are the multiple of i change the condition ( on to off and off to on ).
 

Input
Each test 
case contains only a number n ( 0< n<= 10^5in a line.
 

Output
Output the condition of the n
-th lamp after infinity operations ( 0 - off, 1 - on ).
 

Sample Input
1
5
 

Sample Output
1
0

Hint
hint
 

Consider the second test 
case:

The initial condition       : 
0 0 0 0 0 …
After the first operation  : 
1 1 1 1 1 …
After the second operation : 
1 0 1 0 1 …
After the third operation  : 
1 0 0 0 1 …
After the fourth operation : 
1 0 0 1 1 …
After the fifth operation  : 
1 0 0 1 0 …

The later operations cannot change the condition of the fifth lamp any more. So the answer 
is 0.

題目分析:
毫無疑問 , 從后面的 Consider the second test case 可以看出, 這是一道模擬題, 根據題意直接模擬即可!

代碼如下:
MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

#include 
<iostream>
#include 
<string.h>
using namespace std;
 
int arr[100001];
 
int main()
{
    
int n;
    
while(scanf("%d"&n) != EOF)
    {
        memset(arr, 
0sizeof(arr));
        
for(int i=1; i<=n; ++i)
            
for(int j=1; j<=n&&j*i<=n; ++j)
                arr[j
*i] = !arr[j*i];
        printf(
"%d\n", arr[n]);
    }
    
return 0;
}

但是這樣非常耗時,  有沒更簡單的方法? 當然有!  在草稿紙上模擬后得出: 只要是平方數就是 "1" ,否則為"0" , 所以
直接哈希,0MS過.

代碼如下:
MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

#include 
<iostream>
using namespace std;
int F[100001= { 11 };
int main ()
{
    
for ( int i = 2; i * i <= 100000 ; ++ i )
    {
          F[ i 
* i ] = 1;
    }
    
int N;
    
while ( cin >> N )
    {
          puts ( F[N] 
? "1" : "0" ); 
    }
    
return 0
}


MiYu 2010-08-07 15:20 發表評論
]]>
HDOJ HDU 1982 Kaitou Kid - The Phantom Thief(1) ACM 1982 IN HDU http://www.shnenglu.com/MiYu/archive/2010/08/04/122236.htmlMiYuMiYuWed, 04 Aug 2010 12:04:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/04/122236.htmlhttp://www.shnenglu.com/MiYu/comments/122236.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/04/122236.html#Feedback1http://www.shnenglu.com/MiYu/comments/commentRss/122236.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/122236.html//MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

題目地址 :
         http://acm.hdu.edu.cn/showproblem.php?pid=1982

PE了N次, 很糾結的一個題........  題目如下 :
Problem Description
Do you know Kaitou Kid? In the legend, Kaitou Kid is a master of disguise, and can take on the voice and form of anyone. He is not an evil person, but he is on the wrong side of the law. He's the very elusive phantom thief who never miss his prey although he always uses word puzzles to announce his targets before action.

You are the leader of a museum. Recently, you get several priceless jewels and plan to hold an exhibition. But at the moment, you receive Kid's word puzzle... Fortunately, It seems Kid doesn’t want to trouble you, and his puzzle is very easy. Just a few minutes, You have found the way to solve the puzzle:

(1) change 1 to 'A', 2 TO 'B',..,26 TO 'Z'
(2) change '#' to a blank
(3) ignore the '-' symbol, it just used to separate the numbers in the puzzle

Input
The first line of the input contains an integer C which means the number of test cases. Then C lines follow. Each line is a sentence of Kid’s word puzzle which is consisted of '0' ~ '9' , '-' and '#'. The length of each sentence is no longer than 10000.

Output
For each case, output the translated text.

Sample Input
4 9#23-9-12-12#19-20-5-1-12#1-20#12-5-1-19-20#15-14-5#10-5-23-5-12 1-14-4#12-5-1-22-5#20-8-5#13-21-19-5-21-13#9-14#20#13-9-14-21-20-5-19 1-6-20-5-18#20-8-5#15-16-5-14-9-14-7#15-6#20-8-5#5-24-8-9-2-9-20-9-15-14 7-15-15-4#12-21-3-11

Sample Output
I WILL STEAL AT LEAST ONE JEWEL AND LEAVE THE MUSEUM IN T MINUTES AFTER THE OPENING OF THE EXHIBITION GOOD LUCK


剛開始是用的庫函數 strtok 對字符串進行處理,  直接敲完,沒有出現錯誤, 提交,悲劇開始了

下面的是PE 的代碼 :
//MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

#include 
<iostream>
#include 
<cstdlib>
#include 
<cstring>
using namespace std;
char psw[10005];
char sym[133];
void setSym ( )
{
     
int i;
     
char ch;
     
for ( ch = 'A', i = 1; i <= 26++ i , ++ ch )
     {
           sym[i] 
= ch ;
     } 

string prs ( char *psw )
{
     
string str;
     
int n = strlen ( psw );
     
int num = 0;
     
for ( int i = 0; i != n; ++ i )
     {
           
if ( psw[i] != '-' )
           {
                num 
= num * 10 + psw[i] - '0'
           } 
           
else 
           {
                
if ( num != 0 )
                {
                     str 
+= sym[num];
                }
                num 
= 0
           }
     }
     
if ( num != 0 )
     {
          str 
+= sym[num];
     }
     
return str;
}
int main ()
{
    setSym ();
    
int T;
    
while ( scanf ( "%d\n",&T ) != EOF )
    {
            
while ( T -- )
            {
                    gets ( psw );
                    
string str;
                    
char *ptr = strtok ( psw, "#" );
                    
if ( strlen ( ptr ) != 0 )
                         str 
= prs ( ptr ); 
                    
while ( ptr = strtok ( NULL, "#" ) )
                    {
                           
if ( strcmp ( ptr, "" ) != 0 )
                           {
                                str 
+= " ";
                                str 
+= prs ( ptr ); 
                           }
                    }
                    cout 
<< str << endl;; 
            }           
    }
    
return 0
}

 最后在Ambition 大牛的提示下,成功AC, 因為strtok是忽視被截字符串的個數的 "-----######---##-#-#"
這組數據應該輸出10個空格, 而我的代碼值能輸出3個.
下面的是AC代碼 :
//MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

#include 
<iostream>
#include 
<cstdlib>
#include 
<cstring>
using namespace std;
char psw[20005];
char temp[20005];
char sym[133];
void setSym ( )
{
     
int i;
     
char ch;
     
for ( ch = 'A', i = 1; i <= 26++ i , ++ ch )
     {
           sym[i] 
= ch ;
     } 

string prs ( char *psw )
{
     
string str;
     
int n = strlen ( psw );
     
int num = 0;
     
for ( int i = 0; i != n; ++ i )
     {
           
if ( psw[i] != '-' )
           {
                num 
= num * 10 + psw[i] - '0'
           } 
           
else 
           {
                
if ( num != 0 )
                {
                     str 
+= sym[num];
                }
                num 
= 0
           }
     }
     
if ( num != 0 )
     {
          str 
+= sym[num];
     }
     
return str;
}
int main ()
{
    setSym ();
    
int T;
    
while ( scanf ( "%d",&T ) != EOF )
    {
            getchar ();
            
while ( T -- )
            {
                    gets ( psw );
                    
int len = strlen ( psw );
                    
int beg = 0;
                    memset ( temp, 
'\0'sizeof ( temp ) );
                    
string str;
                    
while ( psw[beg] != '\0' )
                    {
                           
int i = 0
                           
while ( psw[beg] != '#' && psw[beg] != '\0' )
                           {
                                   temp[i
++= psw[beg++]; 
                           }
                           temp[i] 
= '\0';
                           
string t = prs ( temp );
                           
if ( t.size() != 0 )
                           {
                                str 
+= t;
                                
if ( psw[beg] == '#' )
                                {
                                     str 
+= " "
                                }  
                           }
                           
else if ( psw[beg] == '#' )
                           {
                                str 
+= " "
                           }
                           beg 
++;
                    }
                    cout 
<< str << endl;
                    memset ( psw, 
'\0'sizeof ( psw ) );
            }           
    }
    
return 0
}

弄了一個下午加一個晚上才 AC , 是自己把簡單問題想太復雜了............
Roowe 神牛代碼 :
//MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

#include 
<iostream>
#include 
<stdio.h>
#include 
<string.h>
#include 
<ctype.h>
using namespace std;
char str[27]={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
char s[10001];
int main()
{
    
int T,len,i,num;
    scanf(
"%d",&T);
    getchar();
    
while(T--)
    {
        gets(s);
        len
=strlen(s);
        
for(i=0;i<len;i++)
        {
            
if(isdigit(s[i]) && isdigit(s[i+1]))
            {
                num
=10*(s[i]-'0')+s[i+1]-'0';
                printf(
"%c",str[num-1]);
                i
++;
                
continue;
            }
            
if(isdigit(s[i]) && !isdigit(s[i+1]))
            {
                num
=s[i]-'0';
                printf(
"%c",str[num-1]);
                
continue;
            }
            
if(s[i]=='#')   printf(" ");
        }
        printf(
"\n");
    }
    
return 0;
}


MiYu 2010-08-04 20:04 發表評論
]]>
HDOJ HDU 1088 Write a simple HTML Browser ACM 1088 IN HDU http://www.shnenglu.com/MiYu/archive/2010/08/04/122201.htmlMiYuMiYuWed, 04 Aug 2010 06:07:00 GMThttp://www.shnenglu.com/MiYu/archive/2010/08/04/122201.htmlhttp://www.shnenglu.com/MiYu/comments/122201.htmlhttp://www.shnenglu.com/MiYu/archive/2010/08/04/122201.html#Feedback0http://www.shnenglu.com/MiYu/comments/commentRss/122201.htmlhttp://www.shnenglu.com/MiYu/services/trackbacks/122201.html//MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

題目地址 :
      http://acm.hdu.edu.cn/showproblem.php?pid=1088
      模擬HTML 語言...............
標準的模擬題..............PE了好久, 終于A 了
代碼如下 :
//MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋

#include<iostream>
#include 
<string>
using namespace std;
string hr = "--------------------------------------------------------------------------------";
int main()
{
    
string str, str1;
    
int count = 0;
    
while ( cin >> str )
    
{
        
int len = str.size ();
        
if ( str == "<br>" )
        
{
             cout 
<< endl;
             count 
=0;
        }

        
else if ( str == "<hr>" )
        
{
            
if ( count )
            
{
                 cout 
<< endl; 
            }

            cout 
<< hr << endl;
            count 
= 0;
        }

        
else
        
{
            
if ( count + len + 1 <= 80 ) 
            
{
                
if ( count )
                
{
                     cout 
<< " ";
                     count 
++;
                }

                cout 
<< str;
                count 
+= len;
            }

            
else
            
{
                cout 
<< endl;
                count 
= len;
                cout 
<< str;
            }

        }

    }

    cout 
<< endl;
    
return 0;
}



MiYu 2010-08-04 14:07 發表評論
]]>
久久99国产精品成人欧美| 91久久香蕉国产熟女线看| 国产精品综合久久第一页| 久久精品aⅴ无码中文字字幕重口| 热久久国产欧美一区二区精品| 2020最新久久久视精品爱| 韩国免费A级毛片久久| 久久男人Av资源网站无码软件| 无码八A片人妻少妇久久| 亚洲国产成人久久一区久久| 久久久中文字幕日本| 久久噜噜久久久精品66| 久久精品亚洲欧美日韩久久| 久久久久国产成人精品亚洲午夜| 国产99久久久久久免费看| 国产A级毛片久久久精品毛片| 久久综合中文字幕| 国产精品美女久久久久av爽| 久久99精品久久久久久噜噜| 欧美伊人久久大香线蕉综合69| 久久综合亚洲色HEZYO国产 | 亚洲综合精品香蕉久久网| 2021最新久久久视精品爱| 国产精品乱码久久久久久软件 | 青青热久久国产久精品| 综合久久一区二区三区 | 国产精品99久久精品| 久久噜噜电影你懂的| 久久青青国产| 无码国内精品久久综合88 | 国产福利电影一区二区三区久久久久成人精品综合| 97久久精品午夜一区二区| 韩国三级中文字幕hd久久精品| 久久人人爽人爽人人爽av| 精品熟女少妇AV免费久久| 好久久免费视频高清| 蜜桃麻豆www久久国产精品| 亚洲国产精品无码久久久不卡| 久久国产精品久久久| 久久亚洲国产最新网站| 97久久超碰成人精品网站|