建议[code][/code]增加代码高亮功能
- Jarson
- 帖子: 2371
- 注册时间: 2008-07-21 9:44
- 来自: 深圳
- 联系:
- lainme
- 论坛版主
- 帖子: 7805
- 注册时间: 2008-09-13 19:17
- 系统: Arch Linux (x86_64)
- 联系:
- wean
- 帖子: 686
- 注册时间: 2007-04-23 14:47
- 系统: Gentoo
- 来自: 常熟
- 联系:
Re: 建议[code][/code]增加代码高亮功能
[csharp]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using unoidl.com.sun.star.lang;
using unoidl.com.sun.star.bridge;
using unoidl.com.sun.star.frame;
using unoidl.com.sun.star.view;
using unoidl.com.sun.star.beans;
using unoidl.com.sun.star.text;
using unoidl.com.sun.star.style;
using unoidl.com.sun.star.container;
using unoidl.com.sun.star.sheet;
using unoidl.com.sun.star.table;
using unoidl.com.sun.star;
using unoidl.com.sun.star.drawing;
namespace OOoDemo
{
class Program
{
static void Main(string[] args)
{
#region 元件初始化
string sFileName = "C:\\test.xlsx";
unoidl.com.sun.star.uno.XComponentContext m_xContext;
unoidl.com.sun.star.lang.XMultiServiceFactory mxMSFactory;
unoidl.com.sun.star.sheet.XSpreadsheetDocument mxDocument;
unoidl.com.sun.star.container.XIndexAccess xSheetsIA;
unoidl.com.sun.star.sheet.XSpreadsheets xSheets;
unoidl.com.sun.star.sheet.XSpreadsheet xSheet;
// OpenOffice.org 使用網址的方式,因此必須先將檔案路徑做轉換
String sUrl = "file:///" + sFileName.Replace(@"\", "/");
// 載入文件前屬性設定,設定文件開啟時隱藏
PropertyValue[] loadDesc = new PropertyValue[1];
loadDesc[0] = new PropertyValue();
loadDesc[0].Name = "Hidden";
loadDesc[0].Value = new uno.Any(true);
m_xContext = uno.util.Bootstrap.bootstrap();
mxMSFactory = (XMultiServiceFactory)m_xContext.getServiceManager();
XComponentLoader aLoader = (XComponentLoader)mxMSFactory.createInstance("com.sun.star.frame.Desktop");
// 載入文件
XComponent xComp = aLoader.loadComponentFromURL(sUrl, "_blank", 0, loadDesc);
mxDocument = (unoidl.com.sun.star.sheet.XSpreadsheetDocument)xComp;
xSheets = mxDocument.getSheets();
xSheetsIA = (unoidl.com.sun.star.container.XIndexAccess)xSheets;
#region SheetCount
int nSheetCount = xSheetsIA.getCount();
#endregion
xSheet = (unoidl.com.sun.star.sheet.XSpreadsheet)xSheetsIA.getByIndex(0).Value;
#endregion 元件初始化
#region 寫入資料到 Excel
// xSheet = (unoidl.com.sun.star.sheet.XSpreadsheet)xSheets.getByName("yyy").Value;
#region 设置Cell
xSheet.getCellByPosition(1, 1).setFormula(DateTime.Now.ToString("yyyy-MM-dd"));
xSheet.getCellByPosition(1, 2).setFormula("小歐ou");
#endregion
#region 删除sheet
xSheets.removeByName("c");
#endregion
nSheetCount = xSheetsIA.getCount();
xSheets.insertNewByName("MoveSheetTo1", (short)(nSheetCount + 1));
xSheets.moveByName("MoveSheetTo1", 1);
nSheetCount = xSheetsIA.getCount();
xSheets.insertNewByName("AddSheet", (short)(nSheetCount + 1));
nSheetCount = xSheetsIA.getCount();
xSheets.copyByName("a", "aCopy", (short)(nSheetCount + 1));
//用sheet名获得
XSpreadsheet xSheetdeletetest = (XSpreadsheet)xSheets.getByName("b").Value;
//获得range
XCell xCell = xSheetdeletetest.getCellByPosition(1, 1);
xCell.setFormula("TestGetByName");
XCellRange xRangeDeletetest = (XCellRange)xSheetdeletetest;
XColumnRowRange xColumnRowRange = (XColumnRowRange)xRangeDeletetest;
//删除column和row
XTableColumns xColumns = xColumnRowRange.getColumns();
xColumns.removeByIndex(4, 1);
XTableRows xRows = xColumnRowRange.getRows();
xRows.removeByIndex(15, 1);
//Object GraphicObjectObject = mxMSFactory.createInstance("com.sun.star.drawing.RectangleShape");
//XShape GraphicObjectShape = (XShape)GraphicObjectObject;
//xDrawPage.add(GraphicObjectShape);
#region 图片
//添加图片
Object dispatchHelper = mxMSFactory.createInstance("com.sun.star.frame.DispatchHelper");
XDispatchHelper disp = dispatchHelper as XDispatchHelper;
XModel model = xComp as XModel;
XFrame xframe = model.getCurrentController().getFrame();
XDispatchProvider xProvider = xframe as XDispatchProvider;
PropertyValue[] fotogs = new PropertyValue[1];
fotogs[0] = new PropertyValue();
fotogs[0].Name="ToPoint";
fotogs[0].Value = new uno.Any("E9");
uno.Any ret = disp.executeDispatch(xProvider, ".uno:GoToCell", "", 0, fotogs);
PropertyValue[] aargs = new PropertyValue[1];
aargs[0] = new PropertyValue();
aargs[0].Name = "FileName";
aargs[0].Value = new uno.Any("file:///C:/ddddd.jpeg");
ret = disp.executeDispatch(xProvider, ".uno:InsertGraphic", "", 0, aargs);
//////////////////////////////////////////////////////////////////////////
//unoidl.com.sun.star.graphic.XGraphicObject xGraphicObject = unoidl.com.sun.star.graphic.GraphicObject.create(xComp);
//调整图片大小
XDrawPagesSupplier xDrawPagesSupplier = (XDrawPagesSupplier)mxDocument;
XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
int nDrawPageCount = xDrawPages.getCount();
XDrawPage xDrawPage = (XDrawPage)xDrawPages.getByIndex(0).Value;
XDrawPageSupplier xx = (XDrawPageSupplier)xSheet;
XDrawPage xp = xx.getDrawPage();
int nElementCount = xp.getCount();
if (nElementCount > 0)
{
XCellRange xCellRangeImageSize = xSheet.getCellRangeByName("H20:O33");
XPropertySet ps = (XPropertySet)xCellRangeImageSize;
unoidl.com.sun.star.awt.Point pos = (unoidl.com.sun.star.awt.Point)ps.getPropertyValue("Position").Value;
unoidl.com.sun.star.awt.Size siz = (unoidl.com.sun.star.awt.Size)ps.getPropertyValue("Size").Value;
XShape xShape = (XShape)xp.getByIndex(0).Value;
xShape.setSize(siz);
xShape.setPosition(pos);
}
#endregion
//////////////////////////////////////////////////////////////////////////
//BockCopy Macro
PropertyValue[] cotogs = new PropertyValue[1];
cotogs[0] = new PropertyValue();
cotogs[0].Name = "ToPoint";
cotogs[0].Value = new uno.Any("B2:B3");
ret = disp.executeDispatch(xProvider, ".uno:GoToCell", "", 0, cotogs);
ret = disp.executeDispatch(xProvider, ".uno:Copy", "", 0, new PropertyValue[] { });
PropertyValue[] patogs = new PropertyValue[1];
patogs[0] = new PropertyValue();
patogs[0].Name = "ToPoint";
patogs[0].Value = new uno.Any("D2:D3");
ret = disp.executeDispatch(xProvider, ".uno:GoToCell", "", 0, patogs);
ret = disp.executeDispatch(xProvider, ".uno:Paste", "", 0, new PropertyValue[] { });
//BlockCopy API
XCellRangeMovement rangeCopyMove = (XCellRangeMovement)xSheet;
XCellRangeAddressable rangeSrc = (XCellRangeAddressable)xSheet.getCellRangeByName("D2:D3");
XCellAddressable cellDes = (XCellAddressable)xSheet.getCellByPosition(3,7);
rangeCopyMove.copyRange(cellDes.getCellAddress(), rangeSrc.getRangeAddress());
//RowCopy
XCellRange xRangeRowCopy = (XCellRange)xSheet;
XColumnRowRange xColumnRowRowCopy = (XColumnRowRange)xRangeRowCopy;
XTableRows xRowCpoyRows = xColumnRowRowCopy.getRows();
XCellRange xRangeRowCopyRow = (XCellRange)xRowCpoyRows.getByIndex(39).Value;
XCellRangeAddressable rowSrc = (XCellRangeAddressable)xRangeRowCopyRow;
XCellAddressable rowDes = (XCellAddressable)xSheet.getCellByPosition(0, 43);
rangeCopyMove.copyRange(rowDes.getCellAddress(), rowSrc.getRangeAddress());
#endregion 寫入資料到 Excel
#region 保存 另存
PropertyValue[] saveArgs = new PropertyValue[]{
new PropertyValue{
Name="FilterName",
Value=new uno.Any("MS Excel 97")
}
};
unoidl.com.sun.star.frame.XStorable xStorable = xComp as XStorable;
xStorable.storeAsURL("file:///c:/ddd.xls", saveArgs);
#endregion
#region 关闭
unoidl.com.sun.star.util.XCloseable xCloseable =
xComp as unoidl.com.sun.star.util.XCloseable;
xCloseable.close(true);
#endregion
}
}
}
[/csharp]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using unoidl.com.sun.star.lang;
using unoidl.com.sun.star.bridge;
using unoidl.com.sun.star.frame;
using unoidl.com.sun.star.view;
using unoidl.com.sun.star.beans;
using unoidl.com.sun.star.text;
using unoidl.com.sun.star.style;
using unoidl.com.sun.star.container;
using unoidl.com.sun.star.sheet;
using unoidl.com.sun.star.table;
using unoidl.com.sun.star;
using unoidl.com.sun.star.drawing;
namespace OOoDemo
{
class Program
{
static void Main(string[] args)
{
#region 元件初始化
string sFileName = "C:\\test.xlsx";
unoidl.com.sun.star.uno.XComponentContext m_xContext;
unoidl.com.sun.star.lang.XMultiServiceFactory mxMSFactory;
unoidl.com.sun.star.sheet.XSpreadsheetDocument mxDocument;
unoidl.com.sun.star.container.XIndexAccess xSheetsIA;
unoidl.com.sun.star.sheet.XSpreadsheets xSheets;
unoidl.com.sun.star.sheet.XSpreadsheet xSheet;
// OpenOffice.org 使用網址的方式,因此必須先將檔案路徑做轉換
String sUrl = "file:///" + sFileName.Replace(@"\", "/");
// 載入文件前屬性設定,設定文件開啟時隱藏
PropertyValue[] loadDesc = new PropertyValue[1];
loadDesc[0] = new PropertyValue();
loadDesc[0].Name = "Hidden";
loadDesc[0].Value = new uno.Any(true);
m_xContext = uno.util.Bootstrap.bootstrap();
mxMSFactory = (XMultiServiceFactory)m_xContext.getServiceManager();
XComponentLoader aLoader = (XComponentLoader)mxMSFactory.createInstance("com.sun.star.frame.Desktop");
// 載入文件
XComponent xComp = aLoader.loadComponentFromURL(sUrl, "_blank", 0, loadDesc);
mxDocument = (unoidl.com.sun.star.sheet.XSpreadsheetDocument)xComp;
xSheets = mxDocument.getSheets();
xSheetsIA = (unoidl.com.sun.star.container.XIndexAccess)xSheets;
#region SheetCount
int nSheetCount = xSheetsIA.getCount();
#endregion
xSheet = (unoidl.com.sun.star.sheet.XSpreadsheet)xSheetsIA.getByIndex(0).Value;
#endregion 元件初始化
#region 寫入資料到 Excel
// xSheet = (unoidl.com.sun.star.sheet.XSpreadsheet)xSheets.getByName("yyy").Value;
#region 设置Cell
xSheet.getCellByPosition(1, 1).setFormula(DateTime.Now.ToString("yyyy-MM-dd"));
xSheet.getCellByPosition(1, 2).setFormula("小歐ou");
#endregion
#region 删除sheet
xSheets.removeByName("c");
#endregion
nSheetCount = xSheetsIA.getCount();
xSheets.insertNewByName("MoveSheetTo1", (short)(nSheetCount + 1));
xSheets.moveByName("MoveSheetTo1", 1);
nSheetCount = xSheetsIA.getCount();
xSheets.insertNewByName("AddSheet", (short)(nSheetCount + 1));
nSheetCount = xSheetsIA.getCount();
xSheets.copyByName("a", "aCopy", (short)(nSheetCount + 1));
//用sheet名获得
XSpreadsheet xSheetdeletetest = (XSpreadsheet)xSheets.getByName("b").Value;
//获得range
XCell xCell = xSheetdeletetest.getCellByPosition(1, 1);
xCell.setFormula("TestGetByName");
XCellRange xRangeDeletetest = (XCellRange)xSheetdeletetest;
XColumnRowRange xColumnRowRange = (XColumnRowRange)xRangeDeletetest;
//删除column和row
XTableColumns xColumns = xColumnRowRange.getColumns();
xColumns.removeByIndex(4, 1);
XTableRows xRows = xColumnRowRange.getRows();
xRows.removeByIndex(15, 1);
//Object GraphicObjectObject = mxMSFactory.createInstance("com.sun.star.drawing.RectangleShape");
//XShape GraphicObjectShape = (XShape)GraphicObjectObject;
//xDrawPage.add(GraphicObjectShape);
#region 图片
//添加图片
Object dispatchHelper = mxMSFactory.createInstance("com.sun.star.frame.DispatchHelper");
XDispatchHelper disp = dispatchHelper as XDispatchHelper;
XModel model = xComp as XModel;
XFrame xframe = model.getCurrentController().getFrame();
XDispatchProvider xProvider = xframe as XDispatchProvider;
PropertyValue[] fotogs = new PropertyValue[1];
fotogs[0] = new PropertyValue();
fotogs[0].Name="ToPoint";
fotogs[0].Value = new uno.Any("E9");
uno.Any ret = disp.executeDispatch(xProvider, ".uno:GoToCell", "", 0, fotogs);
PropertyValue[] aargs = new PropertyValue[1];
aargs[0] = new PropertyValue();
aargs[0].Name = "FileName";
aargs[0].Value = new uno.Any("file:///C:/ddddd.jpeg");
ret = disp.executeDispatch(xProvider, ".uno:InsertGraphic", "", 0, aargs);
//////////////////////////////////////////////////////////////////////////
//unoidl.com.sun.star.graphic.XGraphicObject xGraphicObject = unoidl.com.sun.star.graphic.GraphicObject.create(xComp);
//调整图片大小
XDrawPagesSupplier xDrawPagesSupplier = (XDrawPagesSupplier)mxDocument;
XDrawPages xDrawPages = xDrawPagesSupplier.getDrawPages();
int nDrawPageCount = xDrawPages.getCount();
XDrawPage xDrawPage = (XDrawPage)xDrawPages.getByIndex(0).Value;
XDrawPageSupplier xx = (XDrawPageSupplier)xSheet;
XDrawPage xp = xx.getDrawPage();
int nElementCount = xp.getCount();
if (nElementCount > 0)
{
XCellRange xCellRangeImageSize = xSheet.getCellRangeByName("H20:O33");
XPropertySet ps = (XPropertySet)xCellRangeImageSize;
unoidl.com.sun.star.awt.Point pos = (unoidl.com.sun.star.awt.Point)ps.getPropertyValue("Position").Value;
unoidl.com.sun.star.awt.Size siz = (unoidl.com.sun.star.awt.Size)ps.getPropertyValue("Size").Value;
XShape xShape = (XShape)xp.getByIndex(0).Value;
xShape.setSize(siz);
xShape.setPosition(pos);
}
#endregion
//////////////////////////////////////////////////////////////////////////
//BockCopy Macro
PropertyValue[] cotogs = new PropertyValue[1];
cotogs[0] = new PropertyValue();
cotogs[0].Name = "ToPoint";
cotogs[0].Value = new uno.Any("B2:B3");
ret = disp.executeDispatch(xProvider, ".uno:GoToCell", "", 0, cotogs);
ret = disp.executeDispatch(xProvider, ".uno:Copy", "", 0, new PropertyValue[] { });
PropertyValue[] patogs = new PropertyValue[1];
patogs[0] = new PropertyValue();
patogs[0].Name = "ToPoint";
patogs[0].Value = new uno.Any("D2:D3");
ret = disp.executeDispatch(xProvider, ".uno:GoToCell", "", 0, patogs);
ret = disp.executeDispatch(xProvider, ".uno:Paste", "", 0, new PropertyValue[] { });
//BlockCopy API
XCellRangeMovement rangeCopyMove = (XCellRangeMovement)xSheet;
XCellRangeAddressable rangeSrc = (XCellRangeAddressable)xSheet.getCellRangeByName("D2:D3");
XCellAddressable cellDes = (XCellAddressable)xSheet.getCellByPosition(3,7);
rangeCopyMove.copyRange(cellDes.getCellAddress(), rangeSrc.getRangeAddress());
//RowCopy
XCellRange xRangeRowCopy = (XCellRange)xSheet;
XColumnRowRange xColumnRowRowCopy = (XColumnRowRange)xRangeRowCopy;
XTableRows xRowCpoyRows = xColumnRowRowCopy.getRows();
XCellRange xRangeRowCopyRow = (XCellRange)xRowCpoyRows.getByIndex(39).Value;
XCellRangeAddressable rowSrc = (XCellRangeAddressable)xRangeRowCopyRow;
XCellAddressable rowDes = (XCellAddressable)xSheet.getCellByPosition(0, 43);
rangeCopyMove.copyRange(rowDes.getCellAddress(), rowSrc.getRangeAddress());
#endregion 寫入資料到 Excel
#region 保存 另存
PropertyValue[] saveArgs = new PropertyValue[]{
new PropertyValue{
Name="FilterName",
Value=new uno.Any("MS Excel 97")
}
};
unoidl.com.sun.star.frame.XStorable xStorable = xComp as XStorable;
xStorable.storeAsURL("file:///c:/ddd.xls", saveArgs);
#endregion
#region 关闭
unoidl.com.sun.star.util.XCloseable xCloseable =
xComp as unoidl.com.sun.star.util.XCloseable;
xCloseable.close(true);
#endregion
}
}
}
[/csharp]
- wean
- 帖子: 686
- 注册时间: 2007-04-23 14:47
- 系统: Gentoo
- 来自: 常熟
- 联系:
- peteryeh64
- 论坛版主
- 帖子: 9386
- 注册时间: 2008-12-20 15:43
- 系统: 家kubuntu20.04
- 来自: 心靈深處
Re: 建议[code][/code]增加代码高亮功能
老大V5...
[python]推敲好久,終於弄明白了,畢竟不是計算機專業[/python]

[python]推敲好久,終於弄明白了,畢竟不是計算機專業[/python]
[论坛版主行为规定]+[PITIVI簡易教程]+[ubuntu裝迅雷]
[releases.ubuntu.com]+[cdimage.ubuntu.com]+[old-releases.ubuntu.com]
[學ubuntu必須拜讀懶蝸牛"笨兔兔的故事"=viewtopic.php?f=112&t=162040][Linux明日的希望在中國]
[releases.ubuntu.com]+[cdimage.ubuntu.com]+[old-releases.ubuntu.com]
[學ubuntu必須拜讀懶蝸牛"笨兔兔的故事"=viewtopic.php?f=112&t=162040][Linux明日的希望在中國]
- link_01
- 帖子: 1024
- 注册时间: 2008-11-05 13:24
Re: 建议[code][/code]增加代码高亮功能
原来是这么回事…… 强
[c]
/* example :
./use-md5
-s=false: only 16-bit.
-u=false: 字母大写.
./use-md5 'hello world!'
fc3ff98e8c6a0d3087d515c0473f8677
./use-md5 -u 'hello world!'
FC3FF98E8C6A0D3087D515C0473F8677
./use-md5 -s 'hello world!'
8c6a0d3087d515c0
./use-md5 -s -u 'hello world!'
8C6A0D3087D515C0
*/
package main
import (
"fmt"
"crypto/md5"
"flag"
"strings"
"os"
)
func Md5(s string) string {
var hh = md5.New()
hh.Write([]byte(s))
result := fmt.Sprintf("%x", hh.Sum())
return result
}
func short(s string) string {
var temp = []byte(s)
s = string(temp[8:24])
return s
}
func upper(s string) string {
return strings.ToUpper(s)
}
var isUpper = flag.Bool("u", false, "字母大写.")
var isShort = flag.Bool("s", false, "only 16-bit.")
func main() {
flag.Parse()
if flag.NArg() != 1 {
flag.PrintDefaults()
os.Exit(1)
}
var ss string = Md5(flag.Arg(0))
if *isUpper {
var sss = upper(ss)
if *isShort {
fmt.Println(short(sss))
} else {
fmt.Println(sss)
}
} else {
if *isShort {
fmt.Println(short(ss))
} else {
fmt.Println(ss)
}
}
}
[/c]
[c]
/* example :
./use-md5
-s=false: only 16-bit.
-u=false: 字母大写.
./use-md5 'hello world!'
fc3ff98e8c6a0d3087d515c0473f8677
./use-md5 -u 'hello world!'
FC3FF98E8C6A0D3087D515C0473F8677
./use-md5 -s 'hello world!'
8c6a0d3087d515c0
./use-md5 -s -u 'hello world!'
8C6A0D3087D515C0
*/
package main
import (
"fmt"
"crypto/md5"
"flag"
"strings"
"os"
)
func Md5(s string) string {
var hh = md5.New()
hh.Write([]byte(s))
result := fmt.Sprintf("%x", hh.Sum())
return result
}
func short(s string) string {
var temp = []byte(s)
s = string(temp[8:24])
return s
}
func upper(s string) string {
return strings.ToUpper(s)
}
var isUpper = flag.Bool("u", false, "字母大写.")
var isShort = flag.Bool("s", false, "only 16-bit.")
func main() {
flag.Parse()
if flag.NArg() != 1 {
flag.PrintDefaults()
os.Exit(1)
}
var ss string = Md5(flag.Arg(0))
if *isUpper {
var sss = upper(ss)
if *isShort {
fmt.Println(short(sss))
} else {
fmt.Println(sss)
}
} else {
if *isShort {
fmt.Println(short(ss))
} else {
fmt.Println(ss)
}
}
}
[/c]
笔记
-------------------------------------
http://blog.163.com/wqt_1101
-------------------------------------
http://blog.163.com/wqt_1101
-
- 帖子: 3173
- 注册时间: 2010-01-13 23:26
-
- 帖子: 598
- 注册时间: 2009-09-19 20:50
Re: 建议[code][/code]增加代码高亮功能
C++ 代码只能用 C, 没有针对 C++ 特有的关键字高亮
[c]
#include <iostream>
using std::cout;
using std::endl;
class hello{
public:
a(){ cout<<"Hello Ubuntu!"<<endl; }
~a(){ cout<<"Bye Ubuntu!"<<endl; }
};
int main(){
hello tmp;
}
[/c]
[c]
#include <iostream>
using std::cout;
using std::endl;
class hello{
public:
a(){ cout<<"Hello Ubuntu!"<<endl; }
~a(){ cout<<"Bye Ubuntu!"<<endl; }
};
int main(){
hello tmp;
}
[/c]
aMule 2.3.1 is coming...
真正动态的 amule-dlp is coming...
本人帐号在2011年1月被盗,在2011年1月3日17:19到2010年1月6日13:34之间本帐号发的一切帖子、短信等与本人无关!
amule-dlp 开发动态
amule-dlp on Google Code
WebArchiver - 基于 wget 的网页归档工具(PyQt4 GUI 前端)
Linux 2.6.34 编译笔记
真正动态的 amule-dlp is coming...
本人帐号在2011年1月被盗,在2011年1月3日17:19到2010年1月6日13:34之间本帐号发的一切帖子、短信等与本人无关!
amule-dlp 开发动态
amule-dlp on Google Code
WebArchiver - 基于 wget 的网页归档工具(PyQt4 GUI 前端)
Linux 2.6.34 编译笔记
-
- 论坛版主
- 帖子: 21308
- 注册时间: 2007-08-02 20:29
- 系统: 窓辺とうこ
Re: 建议[code][/code]增加代码高亮功能
[cpp]Bill Lee 写了:C++ 代码只能用 C, 没有针对 C++ 特有的关键字高亮
#include <iostream>
using std::cout;
using std::endl;
class hello{
public:
a(){ cout<<"Hello Ubuntu!"<<endl; }
~a(){ cout<<"Bye Ubuntu!"<<endl; }
};
int main(){
hello tmp;
}
[/cpp]
- nmsfan
- 帖子: 18958
- 注册时间: 2009-10-16 22:46
- 来自: finland
Re: 建议[code][/code]增加代码高亮功能
老大V5



>>>>推Ubuntu 桌面培训~~<<<<
>>>>想加入/了解gimp汉化吗,点我吧~<<<<
——————————————————————
不推荐wubi,也不推荐你给别人推荐wubi…………
随心而为的感觉真好……
强推mayhem!!
强推ensiferum
>>>>想加入/了解gimp汉化吗,点我吧~<<<<
——————————————————————
不推荐wubi,也不推荐你给别人推荐wubi…………
随心而为的感觉真好……
强推mayhem!!
强推ensiferum
- 退避九舍
- 帖子: 742
- 注册时间: 2010-08-08 20:02
- 系统: Ubuntu 22.04
Re: 建议[code][/code]增加代码高亮功能
[cpp]#include <iostream>
using namespace std;
int main(){
cout<<"test!"<<endl;
return 0;
}[/cpp]
using namespace std;
int main(){
cout<<"test!"<<endl;
return 0;
}[/cpp]
退避九舍:富贵不能淫,贫贱不能移,威武不能屈:坚持ubuntu不动摇!
- cjxgm
- 帖子: 1952
- 注册时间: 2010-04-23 20:40
- 系统: Arch Linux
- 来自: 浙江·杭州
- 联系:
Re: 建议[code][/code]增加代码高亮功能
[c]#if 0
echo '原来如此'
gcc -o sorehodo "$0"
exit 0
#endif
#include <stdio.h>
int main(void)
{
printf("原来如此\n");
return 0;
}[/c]
[bash]cjxgm@clans:~$ sh sorehodo.c
原来如此
cjxgm@clans:~$ ./sorehodo
原来如此[/bash]
echo '原来如此'
gcc -o sorehodo "$0"
exit 0
#endif
#include <stdio.h>
int main(void)
{
printf("原来如此\n");
return 0;
}[/c]
[bash]cjxgm@clans:~$ sh sorehodo.c
原来如此
cjxgm@clans:~$ ./sorehodo
原来如此[/bash]
- xiajing
- 帖子: 30
- 注册时间: 2009-06-10 21:52
Re: 建议[code][/code]增加代码高亮功能
测试一下,找了好久高亮输入的办法才找到,该贴应该置顶或放到faq里
[bash] cat readme[/bash]
[bash] cat readme[/bash]