oj---九度oj---1015
#include<cstdio> #include<algorithm> #include<cstring> using namespace std; int mypow(int k){ int res=1; while(k--){res*=10;} return res; } int main(){ int sum; int a,b,k; while(scanf("%d %d %d",&a,&b,&k)!=EOF){ int tmp=mypow(k);if(a%tmp==b%tmp) printf("-1\n"); else printf("%d\n",a+b); } return 0; }
oj---九度oj---1015
相關推薦
oj---九度oj---1015
class sca pri main esp int nbsp color pre #include<cstdio> #include<algorithm> #include<cstring> using namespace
oj---九度oj--1078---二叉樹重建
pre urn pac uil pri () esp 通過 str 通過兩種遍歷結果重建,必須有中序遍歷(找到根的位置)。 #include<cstdio> #include<cstring> #include<string> #i
oj---九度oj---1043----day of week
sunday clu %d process put else ril nbsp pro #include<cstdio> #include<cstring> int isleap(int n){ if((n%100!=0&&
oj---九度oj---1070----今年的第幾天
struct else print scan mon urn roc style *** 通過與原點的差值來計算第幾天(要+1). #include<cstdio> int isleap(int n){ if((n%100!=0&&
oj----九度oj----1186---第幾天---輸出日期
int 大於 spa return log ... include void ext 利用日期類的nextday(); 或者先加一個月的天數,然後判斷是否大於給定天數,然後再加一個月的天數,在判斷.... #include<cstdio> int isl
oj--九度oj--1018
mem pan main return clas != bre 九度oj size 簡單hash #include<cstdio> #include<cstring> int grade[101]; int main(){ int n;
oj---九度oj---1052
can class res return cst ring code printf log #include<cstdio> #include<cstring> int buf[205]; int main(){ int n;
oj---九度oj---1432
span out color code can tdi bool pan cnblogs 先排版,再輸出。 先定位中心坐標,然後定位左上角坐標,然後開始排版,四邊同步。左上角起始為(1,1) . #include<cstdio> char output[8
oj---九度oj---1433
else blog sin == con for ++ clu return #include<cstdio> #include<algorithm> using namespace std; const double eps=1e-8;
oj---九度oj---1434
printf %d truct sin col break pre nbsp bre #include<cstdio> #include<algorithm> using namespace std; struct Program{
oj--九度oj---1435
比較 col esp == int -1 n) style tdi 貪心,每次選擇濃度最低的。 註意浮點數比較的問題。 AC如下: #include<cstdio> #include<algorithm> #include<cmath&g
oj---九度oj---1153
emp () can top tac != name names main #include<cstdio> #include<stack> using namespace std; char str[110]; char res[110]
oj---九度oj---1107
names cst stack reat priority pac tac turn prior #include<cstdio> #include<iostream> #include<queue> #include<m
oj---九度oj---1201
fine 可讀性 設定 實現 程序 指向 null 我們 附加 0是NULL的一個實現,但NULL不是0。 指針的數值是其所指向的內存的地址。很多時候我們需要標明“這個指針當前為無效指針,它不指向任何可以使用的內存空間”,因為不能在指針外附加一個標誌位,所以就需要設定一
oj---九度oj---1078
har == return string tdi tr1 break cnblogs creat #include<cstdio> #include<cstring> struct Node{ Node* lchild; N
九度OJ 題目1204:農夫、羊、菜和狼的故事
pla pan wol 題目 r+ ear play struct tab 思路:廣度 優先 記錄路徑長度 但是題目的意思好像是要記錄具體路徑 下次再搞吧 題目描述: 有一個農夫帶一只羊、一筐菜和一只狼過河.果沒有農夫看管,則狼要吃羊,羊要吃菜.但是船很小,只
九度OJ-題目1009:二叉搜索樹
提交 二叉排序樹 軟件 amp cpp creat .com xheditor ear 題目1009:二叉搜索樹 從如今開始打算重新啟動刷題征程。程序猿的人生不須要解釋! 這次撇開poj hoj等難度較大的oj系統,從九度入手(已經非常長時間沒寫過代碼
<九度 OJ>題目1012:暢通project
數組下標 find cout set href col 設置 data [] 題目描寫敘述: 某省調查城鎮交通狀況,得到現有城鎮道路統計表。表中列出了每條道路直接連通的城鎮。省政府“暢通project”的目標是使全省不論什麽兩個城鎮間都能夠實現
九度OJ-1112-導彈攔截-最長不增子序列
研究生 -h 計算 不能 problems ear 來源 分隔 std 題目1112:攔截導彈 時間限制:1 秒 內存限制:32 兆 特殊判題:否 提交:5218 解決:2603 題目描述: 某國為了防禦敵國的導彈襲擊,開發出一種導彈攔截系統。但是這種導彈攔截系統有一
九度OJ 1482:瑪雅人的密碼
清華 sizeof swap name substr wap 如果 found www 題目描述: 瑪雅人有一種密碼,如果字符串中出現連續的2012四個數字就能解開密碼。給一個長度為N的字符串,(2=<N<=13)該字符串中只含有0,1,2三種數字,問這個字符串