前言
在這辭舊迎新的時刻,az_debugIT提前給您拜年啦?,
您及全家春節愉快,身體健康,平安吉祥!
牛
氣
沖天!
Today is the Eve of lunar year of 2020. Everyone may either got so much or remain regreted about something in 2020. Anyway it is the past year,a frufilful year for everyone. We will have bravery and change rather than fear and complaint in the new year. We can make differences , make believe and make available in the new year.
Happy Chinese New Year!
今天是除夕,回首過去的一年,也許你識訓滿滿,也許仍心懷遺憾,凡是過往,皆為序章,新的一年,讓我們告別怯懦,更加勇敢;告別抱怨,嘗試改變;告別浮躁,變得更好,牛年將至,讓我們整裝出發,擁抱更多可能,新年快樂!
學習很多語言,java、scala、golang、python,背后都要c語言的影子,大學那時候,基礎學的也是c語言,借此用滿滿的愛心,通過一個有趣的c語言程式,溫習一下c語言撰寫,及運行正確姿勢,
正題
簡單安裝環境依賴
不像以前學習c語言,在windows下還要什么編譯環境,及IDE……現在linux環境一大把,安裝上軟體工具,就可以用……
yum -y install gcc gcc-c++ kernel-devel
畫“心”c程式
vim heart.c
輸入一下代碼
#include <stdio.h>
#include <math.h>
int main()
{
float x, y, f;
for(y = 1.6; y >= -1.6; y -= 0.15){
for(x = -1.1; x <= 1.1; x += 0.05){
f = x*x + pow(y - pow(x*x, 1.0/3), 2) - 1; //函式方程
putchar(f <= 1E-5 ? '*' : ' ');
}
putchar('\n');
}
for(y = 1.6; y >= -1.6; y -= 0.15){
for(x = -1.1; x <= 1.1; x += 0.05){
f = x*x + pow(y - pow(x*x, 1.0/3), 2) - 1; //函式方程
putchar(f > 1E-5 ? '*' : ' ');
}
putchar('\n');
}
return 0;
}
保存關閉,
編譯heart.c
gcc heart.c -lm -o heart
通過-lm鏈接到math.h庫
-o 是輸出為執行檔案heart

執行“執行程式”
[root@oracledb ~]# ./heart

結尾
新年,辭舊迎新,用“心”,給大家拜年:
祝大家新年快樂!
在新的一年里牛氣十足、牛轉乾坤、牛運沖天 牛年大吉、牛市亨通、牛年你最牛!
Happy Chinese New Year!
It's the Year of the Ox, a symbol for hard work and diligence, so this year is good for careers and fortune. May you find success this year!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/259047.html
標籤:AI
