作业-实验一-倒三角

#include<stdio.h>
int main()
{
    printf("*********\n *******\n  *****\n   ***\n    *");

}

首先道个歉,这几天事情有点多结果把作业落下了真的很不好意思。

说真的,这个程序很基础,其中包含的知识也是少的可以:

#include<stdio.h>程序的起始

int main() 主函数(有且只有一个)

printf 输出

这个实验主要就是这几个知识点的实际应用。

不过虽然早已写过,但还有一个我以前没有学到的东西,那就是return 0的省略。

这也是自己了解的,记得不错的话,如果没有写,编译器会默认性的加上return 0,以结束这个程序。

另外return作为“返回值”也可以用作很多地方的结束。

希望没有说错的地方,还望老师和各位学长学姐指导。感激不尽。

时间: 2024-08-05 07:09:35

作业-实验一-倒三角的相关文章

【DAY2】输出正三角和倒三角的实验

class Triangle2 { public static void main(String[] args){ int x,y; for(x=1;x<=5;x+=1){ for(y=1;y<=x+5;y+=1){ System.out.print("\t"); while(y==6-x){ System.out.print("*"); break; } } //System.out.print("\t"); System.out.

jQuery 倒三角 正三角

智障啊! 今天脑抽了想写一个jQuery 倒三角锻炼自己,想了半天才有一点头绪. 研究结果如下: <script type="text/javascript"> $(function(){ var str = "*"; //正三角 for(i = 0;i < 5;i++){ for(j=0;j < i;j++){ document.write(str); } document.write("<br>"); }

Html 中select标签的边框与右侧倒三角的去除

首先是边框的去除:可以设置属性border:none;或border:0px; 不过这还是有一个bug,不同浏览器会在选中select标签时,加上一个边框: 之后是右侧倒三角的去除:设置属性 appearance:none; 以下所有属性兼容当前主流浏览器:appearance:none; -moz-appearance:none; -ms-appearance:none; -o-appearance:none; -webkit-appearance:none; (不过对与IE浏览器这个属性好像

用C# 实现正三角 倒三角 和乘法九九表

1.正三角: namespace zhengsanjiao { class Program { static void Main(string []arges) { for(int a=0;a<=10;a++)     //行数 { for(int b=0;b<=a;b++)   //个数 Console.Write(b); Console.WriteLine(); } } } } 2.倒三角: namespace daosanjiao { class Program { static voi

图形的正、倒三角

正三角 import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("请输入行数:"); int sum=input.nextInt(); for(int i=0;i<sum;i++){ for(int a=0;a<=i;a++){ System.out

倒三角

实现倒三角的输出 public class a { public static void main(String[] args) { int i,j,k; for(i=0;i<4;i++) { for(k=0;k<=i;k++) { System.out.print(" "); } for(j=0;j<4-i;j++) { System.out.print("* "); } System.out.print("\n"); } }

使用css(border)边框实现倒三角

<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>使用border制作倒三角</title> </head> <body> <style> .arrow_01 { width: 0; height: 0; border: 60px solid #000; border-color: blue transpa

html+CSS实例效果(5):em实现倒三角的提示效果

<div class="c_page mt14 clearfix"> <span class="record">1/14P   134Records</span> <span class="first disable"><em class="bar"></em><em class="leftjib"></em>&

打印正/倒三角

package com.demo1; /** * 打印正/倒三角 * * @author denny 正三角改变 初始化值 侄三角改变 循环条件 */ public class Demo6 { public static void main(String[] args) { print(5); // 倒直角三角 printzhen(4);// 正直角三角 printZhenDenng(5);// 正等腰三角形 printDaoDenng(5); // 倒等腰三角形 } // 倒直角三角 publ