Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

sscanf好好用啊

Posted by llyanwenyuan at 2012-02-27 20:07:14 on Problem 1463
先用scanf读入一个字符串,遇到空格停止读入,再用sscanf读入根节点和儿子节点的数目。
如0:(1) 1
scanf("%s", str);
此时str为0:(1), 再sscanf(str, "%d:(%d", &root, &num);
root = 0, num = 1;       ok!

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator