![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法训练
LlveSzy
这个作者很懒,什么都没留下…
展开
-
【提炼翻译+解题】PTA 1004 Counting Leaves 仅用vector 共40行
题目大意Input:第一行 M N 分别是 总节点个数 非叶节点个数接下来的N行中的某一行: 第一个值ID为当前非叶节点序号 K为有几个孩子 然后依次是K个孩子的节点序号例如 01 02 0304 ←这样一棵树有:M = 4 N = 2ID = 01 K = 2 02 03ID = 02 K = 1 04...原创 2018-06-16 21:32:52 · 599 阅读 · 0 评论 -
PTA 1005 Spell It Right
给定一个整数N (100位以下)将每一位相加的总和再按位表示为英文如Input: 12345 1+2+3+4+5 = 15output: one five#include<iostream> #include<string> #include<math.h> using namespace std; string format(int a){...原创 2018-06-17 21:38:23 · 196 阅读 · 0 评论