linux下c++/go/c#/java学习例子

代码例子已托管到svnserve
20190928添加:
cpptest - Revision 1: /   https://svnserve.com/cpptest/
apt install subversion
root@iZ8vb0mp96vvgq12ksoizhZ:/home/hxh/cpptest# svn --version
svn, version 1.9.7 (r1800392)
   compiled Mar 28 2018, 08:49:13 on x86_64-pc-linux-gnu
svn checkout  https://svnserve.com/cpptest --username Ivanhan2019
mv cpp/* cpptest
cd cpptest
svn add *
svn commit -m "cpptest"

CentOS 7下安装Mono
su -c 'curl  https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'
yum install mono-devel
[root@localhost ~]# mono --version
Mono JIT compiler version 6.4.0.198 (tarball Mon Sep 23 20:53:41 UTC 2019)
[root@localhost ~]# yum install subversion
[root@localhost ~]# svn --version
svn, version 1.7.14 (r1542130)
   compiled Apr 11 2018, 02:40:28
[root@localhost cstest]# ls
Hello.cs
[root@localhost cstest]# mcs Hello.cs
[root@localhost cstest]# ls
Hello.cs  Hello.exe
[root@localhost cstest]# mono Hello.exe
3
5
[root@localhost cstest]# vi Hello2.cs
[root@localhost cstest]# ls
Hello2.cs  Hello.cs  Hello.exe
[root@localhost cstest]# mcs Hello2.cs
[root@localhost cstest]# ls
Hello2.cs  Hello2.exe  Hello.cs  Hello.exe
[root@localhost cstest]# mono Hello2.exe
1 man
[root@localhost cstest]# svn diff Hello.cs
Index: Hello.cs
===================================================================
--- Hello.cs(revision 2)
+++ Hello.cs(working copy)
@@ -1,5 +1,5 @@
 using System;
-//第一个C#程序“Hello World!”
+// 第一个C#程序
 namespace HelloWorld
 {
 class Hello 
@@ -16,4 +16,4 @@
 Console.WriteLine(shapes[3].Length);//5 
 }
 }
-}
\ No newline at end of file
+}
[root@localhost cstest]# svn commit -m "modify *.cs by unix2dos" Hello.cs
Sending        Hello.cs
Transmitting file data .
Committed revision 3.
[root@localhost cstest]# svn status
?       Hello2.cs
?       Hello2.exe
[root@localhost cstest]# svn add *
A         Hello2.cs
A  (bin)  Hello2.exe
[root@localhost cstest]# svn ci -m ""
Adding         Hello2.cs
Adding  (bin)  Hello2.exe
Transmitting file data ..
Committed revision 4.
 
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest# go version
go version go1.12.1 linux/amd64
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest# svn --version
svn, version 1.9.7 (r1800392)
   compiled Mar 28 2018, 08:49:13 on x86_64-pc-linux-gnu
root@dthero_cn:/home/yiyou/gopath# cd /home/yiyou/gopath/cpptest/gotest/jiekou1
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest/jiekou1# ls
jiekou1.exe  jiekou1.go
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest/jiekou1# go build
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest/jiekou1# ls
jiekou1  jiekou1.exe  jiekou1.go
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest/jiekou1# ./jiekou1
Hello!
你好!
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest/jiekou1# cd ..
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest# svn status
?       jiekou1
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest# svn add jiekou1
A         jiekou1
A  (bin)  jiekou1/jiekou1
A  (bin)  jiekou1/jiekou1.exe
A         jiekou1/jiekou1.go
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest# svn ci -m "golang test"
Adding         jiekou1
Adding  (bin)  jiekou1/jiekou1
Adding  (bin)  jiekou1/jiekou1.exe
Adding         jiekou1/jiekou1.go
Transmitting file data ...done
Committing transaction...
Committed revision 6.
 
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest# apt install openjdk-11-jre-headless
root@dthero_cn:/home/yiyou/gopath/cpptest/gotest# java --version
openjdk 11.0.4 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing)
 
 

猜你喜欢

转载自www.cnblogs.com/Ivanhan2019/p/11602480.html
今日推荐