A1031】的更多相关文章

A1031 Hello World for U (20)(20 分) Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, "helloworld" can be printed as: h d e l l r lowo That is, the characters must be printed in the…
Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, "helloworld" can be printed as: h d e l l r lowo That is, the characters must be printed in the original order, starting top-down f…
思路: 读取数组 int i = 0; while(cin >> word) { c[i] = word; i++; } 计算边长 int n1 = (length + 2) / 3; int n2 = n1 + (length + 2) % 3; 输出 AC代码 #include <cstdio> #include <iostream> int const max_n = 85; using namespace std; int main() { #ifdef ONL…
画图,用二维数组作为画布 #include<cstdio> #include<string.h> int main(){ ],u[][]; scanf("%s",&c); memset(u,' ',sizeof(u)); ; ,n2=n/+n%,index=; ;i<n1;i++) u[i][]=c[index++]; ;i<=n2-;i++)u[n1-][i]=c[index++]; ;i>=;i--)u[i][n2-]=c[inde…
Given any string of N (≥) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as: h d e l l r lowo That is, the characters must be printed in the original order, starting top-down from the left…
B1027. 打印沙漏 (20) Description: 本题要求你写个程序把给定的符号打印成沙漏的形状.例如给定17个"*",要求按下列格式打印 ***** *** * *** ***** 所谓"沙漏形状",是指每行输出奇数个符号:各行符号中心对齐:相邻两行符号数差2:符号数先从大到小顺序递减到1,再从小到大顺序递增:首尾符号数相等. 给定任意N个符号,不一定能正好组成一个沙漏.要求打印出的沙漏能用掉尽可能多的符号. Input: 输入在一行给出1个正整数N(&…
1031 Hello World for U (20 分) Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as: h d e l l r lowo That is, the characters must be printed in the original order,…
题目AC汇总 甲级AC PAT A1001 A+B Format (20 分) PAT A1002 A+B for Polynomials(25) PAT A1005 Spell It Right (20) PAT A1006 Sign In and Sign Out (25) PAT A1009 Product of Polynomials(25) PAT A1011 World Cup Betting(20) PAT A1012 Best Rank(25) PAT A1016 Phone B…
专题一  字符串处理 A1001 Format(20) #include<cstdio> int main () { ]; int a,b,sum; scanf ("%d %d",&a,&b); sum=a+b; ) { printf ("-"); sum=-sum; } ; ) { s[top++]=; } ) { s[top++]=sum%; sum/=; } ;i>=;i--) { printf ("%d"…