始终显示格式错误,求大佬帮忙看看,谢谢~
#include
(5850)#include
using namespace std;
int main()
{
string s;
while(cin>>s)
{
int left = 0, right = s.length()-1;
int n1,n2,n3;
n1 = n3 = (s.length()+2)/3;
n2 = s.length()+2 - (s.length()+2)*2/3;
for(int i = 1; i < n1; i++)
{
cout< for(int j = 1; j <= n2-2; j++)
cout<<' ';
cout< }
while(left<=right)
cout< cout< }
}
#include
(5850)#include
using namespace std;
int main()
{
string s;
while(cin>>s)
{
int left = 0, right = s.length()-1;
int n1,n2,n3;
n1 = n3 = (s.length()+2)/3;
n2 = s.length()+2 - (s.length()+2)*2/3;
for(int i = 1; i < n1; i++)
{
cout<
cout<<' ';
cout<
while(left<=right)
cout<
}
「求助大佬帮看看这道算法题吧!」Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. Fo...
https://gw-c.nowcoder.com/api/sparta/jump/link?link=https%3A%2F%2Fwww.nowcoder.com%2FquestionTerminal%2Fc6e414fddd7c401887c350c9cc41f01b
全部评论
已解决,谢谢~
相关推荐
01-02 18:35
青岛大学 C++ 点赞 评论 收藏
分享