这个月的全部文章
@kidultff

PAT 2019甲级春季考试真题2 Anniversary

Zhejiang University is about to celebrate her 122th anniversary in 2019. To prepare for the celebration, the alumni association (校友会) has gathered the ID's of all her alumni. Now your job is to write a program to count t ...
  • 0
  • 0
@kidultff

PAT 2019甲级春季考试真题1 Sexy Primes

Sexy primes are pairs of primes of the form (p, p+6), so-named since "sex" is the Latin word for "six". (Quoted from http://mathworld.wolfram.com/SexyPrimes.html)Now given an integer, you are suppose ...
  • 0
  • 0
@kidultff

C++计算2019的阶乘(C++超大数阶乘)

不能使用任何整型变量,2019的阶乘很大很大。使用string是比较好的办法。每次计算时,每一位转成数字,乘以i,并保存10以上的进位。进位最后转成字符串型放在ans之前。:#include <bits/stdc++.h> using namespace std; ...
  • 0
  • 2
@kidultff

PAT-A 真题 – 1139 First Contact

Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a girl B, he would usually not contact her directly in the first place. Instead, h ...
  • 0
  • 0
@kidultff

PAT-A 真题 – 1067 Sort with Swap(0, i)

Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2, 1, 3} w ...
  • 0
  • 0