使用metaweblog上传随笔后格式错误
Closed this issue · 5 comments
Somnus commented
上传内容如下
给定一个二叉树,检查它是否是镜像对称的。
例如,二叉树 [1,2,2,3,4,4,3] 是对称的。
1 / \ 2 2 / \ / \ 3 4 4 3
但是下面这个 [1,2,2,null,3,null,3] 则不是镜像对称的:
1 / \ 2 2 \ \ 3 3
进阶:
你可以运用递归和迭代两种方法解决这个问题吗?
C#代码
/**
* Definition for a binary tree node.
* public class TreeNode {
* public int val;
* public TreeNode left;
* public TreeNode right;
* public TreeNode(int x) { val = x; }
* }
*/
public class Solution {
public bool IsSymmetric(TreeNode root) {
return IsSymmetric(root,root);
}
public bool IsSymmetric(TreeNode p,TreeNode q) {
if(p == null && q == null) return true;
if(p == null || q == null) return false;
if(p.val != q.val) return false;
return IsSymmetric(p.right, q.left) && IsSymmetric(p.left, q.right);
}
}
但在博客园管理后台显示格式
给定一个二叉树,检查它是否是镜像对称的。
例如,二叉树 [1,2,2,3,4,4,3] 是对称的。
1
/
2 2
/ \ /
3 4 4 3
但是下面这个 [1,2,2,null,3,null,3] 则不是镜像对称的:
1
/
2 2
\
3 3
进阶:
你可以运用递归和迭代两种方法解决这个问题吗?
C#代码 /** * Definition for a binary tree node. * public class TreeNode { * public int val; * public TreeNode left; * public TreeNode right; * public TreeNode(int x) { val = x; } * } */ public class Solution { public bool IsSymmetric(TreeNode root) { return IsSymmetric(root,root); } public bool IsSymmetric(TreeNode p,TreeNode q) { if(p == null && q == null) return true; if(p == null || q == null) return false; if(p.val != q.val) return false; return IsSymmetric(p.right, q.left) && IsSymmetric(p.left, q.right); } }
即传上去后代码格式错误。
cnblogs-team commented
您好, 建议您检查下您输入的格式, 这边使用 OpenLiveWriter 测试后是正常的
Fu XuYang <notifications@github.com> 于2020年12月24日周四 下午3:51写道:
… 上传内容如下
给定一个二叉树,检查它是否是镜像对称的。
例如,二叉树 [1,2,2,3,4,4,3] 是对称的。
1
/ \
2 2
/ \ / \
3 4 4 3
但是下面这个 [1,2,2,null,3,null,3] 则不是镜像对称的:
1
/ \
2 2
\ \
3 3
*进阶:*
你可以运用递归和迭代两种方法解决这个问题吗?
C#代码
/**
* Definition for a binary tree node.
* public class TreeNode {
* public int val;
* public TreeNode left;
* public TreeNode right;
* public TreeNode(int x) { val = x; }
* }
*/
public class Solution {
public bool IsSymmetric(TreeNode root) {
return IsSymmetric(root,root);
}
public bool IsSymmetric(TreeNode p,TreeNode q) {
if(p == null && q == null) return true;
if(p == null || q == null) return false;
if(p.val != q.val) return false;
return IsSymmetric(p.right, q.left) && IsSymmetric(p.left, q.right);
}
}
但在博客园管理后台显示格式
给定一个二叉树,检查它是否是镜像对称的。
例如,二叉树 [1,2,2,3,4,4,3] 是对称的。
1
/
2 2
/ \ /
3 4 4 3
但是下面这个 [1,2,2,null,3,null,3] 则不是镜像对称的:
1
/
2 2
\
3 3
进阶:
你可以运用递归和迭代两种方法解决这个问题吗?
C#代码 /** * Definition for a binary tree node. * public class TreeNode { *
public int val; * public TreeNode left; * public TreeNode right; * public
TreeNode(int x) { val = x; } * } */ public class Solution { public bool
IsSymmetric(TreeNode root) { return IsSymmetric(root,root); } public bool
IsSymmetric(TreeNode p,TreeNode q) { if(p == null && q == null) return
true; if(p == null || q == null) return false; if(p.val != q.val) return
false; return IsSymmetric(p.right, q.left) && IsSymmetric(p.left, q.right);
} }
即传上去后代码格式错误。
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#401>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALQKIVAOMHZ63PSJSEOMQRLSWLXITANCNFSM4VH5NG3Q>
.
--
***********************************
博客园团队
很高兴为您服务
https://www.cnblogs.com/
博客园 - 代码改变世界
Somnus commented
您好,我这边是基于metaweblog的method metaWeblog.newPost方法使用.NET C# xmlRPC实现。
xmlRPC接口封装
[XmlRpcMethod("metaWeblog.newPost")]
string NewPost(string blogid, string username, string password, Post post, bool publish);
调用代码
ICNBlogsInterface proxy = XmlRpcProxyGen.Create<ICNBlogsInterface>();
var addResult = proxy.NewPost(blogId, userName, password, new Post()
{
title = name,
description = content,
dateCreated = DateTime.Now,
categories = categories
}, false);
上传时设置了title、description、dateCreated、categories 四个字段值,其他字段均未设置。
故还请老师指教,哪里未处理对。
cnblogs-team commented
您好,如果博文内容用的是 markdown,需要在分类名称中传入[Markdown]
Somnus commented
好的,我试试,谢谢。
Somnus commented
我试了带上[Markdown]上传后的代码格式就正常了,非常感谢。