#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
int code[11]={64,32,16,8,4,2,1};
char input[20]={'\0'};
int main(){
freopen("input.txt", "r", stdin);
int end_count=0;
while(1){
int output=0;
gets(input);
//puts(input);
if(input[0]=='_')end_count++;
if(end_count==2)break;
if(input[0]!='_'){
if(input[2]=='o')output+=64;
if(input[3]=='o')output+=32;
if(input[4]=='o')output+=16;
if(input[5]=='o')output+= 8;
if(input[7]=='o')output+= 4;
if(input[8]=='o')output+= 2;
if(input[9]=='o')output+= 1;
printf("%c",output);
}
//system("PAUSE");
}
return 0;
}
2014年9月13日星期六
[UVa] 10878 - Decode the tape
訂閱:
發佈留言 (Atom)
-
因為先前寫UVa時,檔案名稱有時會花心思改,有時就直接把題目名稱加上.cpp就貼上了 導致現在有不同的格式出現 現在要處理的事情很簡單 1. 去除空白 2. 將底線 ( _ ) 換成dash ( - ) 經過一番查詢,終於發現最簡單的方法 - re...
-
文章出處: http://infbugs.blogspot.tw/2011/12/c_20.html 謝謝沙耶,解答了我長久以來對於 input/output 的疑惑。 C 語言入門 - 在線上批改系統練功 如何練習使用基本語法 自己出個練習題試著寫...
-
因為X205的架構非常獨特,Linux對其硬體的支援度非常弱(據說kernel4.0之後有所改善,這倒還需要研究一番),目前的進度是將Ubuntu系統塞進32Gb的固態碟中,並設定能自動抓取開機磁區,之後可能還要針對WIFI、音效、快捷鍵和讀卡機等週邊設備進行設定。 1...
沒有留言:
發佈留言