原创 Kaleidoscope: Tutrial Introduction and the Lexer

Kaleidoscope: Tutorial Introduction and the LexerBasic LanguageKaleidoscopeThe Lexer 詞法分析器 Basic Language Kaleidosc

原创 qemu安裝及與宿主機通信

qemu安裝 sudo apt-get install qemu qemu-user user模式聯網 默認IP爲10.0.2.15,只能虛擬機連接宿主機,默認宿主機的地址位客戶機所在網絡的第2個IP地址,10.0.2.2不能直

原创 c語言裏單鏈表的創建與增減

單鏈表的創建與元素的增減操作 /** * Single Way List * print all list after do a operator. * task1: * create: create a List w

原创 疊框之scanf空格

找了半天bug,才發現scanf裏沒有空格,輸入的時候我卻加了空格。 覺着今天這個疊框循環控制有點難,還是沒怎麼看懂。繼續看幾遍。。 #include<stdio.h> int main(){ int buf[82][82]

原创 EOF&.0

while裏面不能少EOF不然會超時,double運算分母要加.0。 #include <stdio.h> #include <stdlib.h> #include<math.h> int main() {     double x0,y

原创 對稱平方數

interesting #include <stdio.h> #include <stdlib.h> int isC(int x){               int s=x*x;               int flag=1;  

原创 斐波那契圖形

interesting~~ #include <stdio.h> int F(int n){ int s; if(n==0||n==1) s=n; else s=F(n-2)+F(

原创 old bill

英文題目只要仔細讀題,並不是很難。 自己還是要多做題,代碼可以優化很多。 #include <stdio.h> #include <stdlib.h> int main() {     int n,x,y,z,sum,a,b;     w

原创 今天第幾天

也是醉了,,,連閏年怎麼判斷的都忘了,呵呵呵。。。 細節不注意真的是個大問題。 #include <stdio.h> #include <stdlib.h> int isrun(int year){     if((year%4==0&&

原创 struct在c與c++裏的區別

以前好多問題都沒有注意,c和c++混在一起用,出了問題解決了就不管了。所以一直忽略了這個問題。 struct作爲類的一種特例,是用來自定義數據結構的,在編程的過程中是很有用的。C和C++的主要區別是:一個結構標記聲明後,C語言必須在結構標

原创 Coincidence

雖然做過這一題,簡直崩潰,交大的題目可真難。。。 這次是算長度,還簡單些。。。 #include<stdio.h> #include<string.h> char a[105]; char b[105]; int c[105][105];

原创 最長字段和

所以多刷題才能多見識,慢慢積累,冰凍三尺非一日之寒,真的是這樣。 還是要多注意細節。 #include <stdio.h> #include <limits.h> int main() { long a; long lo

原创 Hash小應用

對於圖片中的題目,很自然想到了用數組來存取,但是hash表真的超好用! */ #include <iostream> using namespace std; int s[1005]; int main() {     int n,g,

原创 楊輝三角形

題目說要用遞歸,可不用也可以AC,而且用了反而超時了,是我的代碼有問題嗎?。。。 /*nclude<stdio.h> int main(){     int a[101][101];     int n,i,j;     while(sc

原创 gcc 8.2.0中新建一個pass

在gcc 8.2.0中新建一個pass 參考的是GCC Resource Center,裏面有對gcc的講解slice。 在/gcc8.2.0/gcc目錄下添加一個文件test.c,然後創建一個主函數,這裏主函數我暫時沒加,只建