码迷,mamicode.com
首页 > 其他好文 > 详细

go练习题

时间:2020-11-25 12:30:03      阅读:4      评论:0      收藏:0      [点我收藏+]

标签:com   http   info   main   png   ima   str   pac   imp   

1.打印10*8的矩形

package main

import "fmt"

//练习1打印10*8的矩形在MethodUtils结构体中
type MethodUnits struct {

}
func (m MethodUnits) Print(){
	for i:=0;i<10;i++ {
		for j:=0;j <8;j++ {
			fmt.Print("*");
		}
		fmt.Println();
	}
}
func main() {
	info:=MethodUnits{};
	info.Print();
}

 案例演示

技术图片

 

go练习题

标签:com   http   info   main   png   ima   str   pac   imp   

原文地址:https://www.cnblogs.com/zh718594493/p/14016014.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!