![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
水题
随笔执念
学生,爱学习,爱编程,爱生活。
展开
-
LeetCode-58. Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word (last word means the last appearing word if we loop from left to right) in the st...原创 2020-03-22 11:40:27 · 112 阅读 · 0 评论 -
LeeCode-53. Maximum Subarray
Given an integer array nums, find the contiguous subarray(containing at least one number) which has the largest sum and return its sum.1. first we need to define sum as the maximum at present. t...原创 2020-03-22 10:50:38 · 115 阅读 · 0 评论 -
输入n,输出对应的边长为n的空心正六边形。 为方便看图,样例中点 '.' 表示空格,打印图形时请打印空格而非小圆点。
#includeusing namespace std;int main(){int n,i,j,t;while(cin>>n){for(i=0;icoutfor(i=0;icoutcoutt=1;for(i=1;ifor(j=0;jcoutcoutfor(j=0;jcoutcoutif(i>=n-1)t--;el原创 2017-04-04 22:28:36 · 4104 阅读 · 0 评论