日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > c/c++ >内容正文

c/c++

华南理工大学 高级程序设计语言 c++ ,2017华南理工大学网络教育《高级语言程序设计C++》平时作业...

發(fā)布時間:2024/10/8 c/c++ 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 华南理工大学 高级程序设计语言 c++ ,2017华南理工大学网络教育《高级语言程序设计C++》平时作业... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

4.函數(shù)create從鍵盤輸入整數(shù)序列,以輸入0為結(jié)束。按輸入順序建立單向鏈表并返回表頭。

struct node{int data; node * next;};

node * create()

{

node *head, *p, *q; p = new node; head = p; cin>>p->data;

while( p->data != 0 ) {

q = p;

p = new node ; q->next = p; cin>>p->data; }

if (head == p) head = NULL;

else q->next = p ; if (head == NULL) delete p ; return head; }

5.以下程序求方程的全部整數(shù)解:

3x + 2y - 7z = 5 ( 0 ≤ x, y, z ≤ 100 )

#includevoid main() { int x, y, z ;

for( x=0; x<=100; x++ ) for( y=0; y<=100; y++ ) { if( ( z=3*x+2*y-5 ) % 7 )

break ;

//求出z的值

s=s+(1.0/(n*n*n) ;

if( z<=100&&z>=0 ) //檢查z的范圍

cout << \ } }

三、程序設(shè)計

1. 編寫函數(shù)輸出以下形狀的圖形,其中構(gòu)成圖形的數(shù)字和輸出的行數(shù)通過參數(shù)傳送。

1 2 2 2 3 3 3 3 3 4 4 4 4 4 4 4

#includevoid main() {

int i,n;

for (i=0;i<5; i++){ for (n=0;n<2*i-1;n++){ cout<

cout<2. 請編程序,輸入兩個正整數(shù)啊a和b(a

the factors of 6 : 2 3

the factors of 7 : no factor

the factors of 8 : 2 4

#include using namespace std; void printFactor(int i); void main() {

int numA,numB;

cout<

cin>>numA>>numB;

for (int i=numA;i<=numB;i++)

{

printFactor(i);

} }

void printFactor(int i) {

cout<

for (int k=2;k

if (i%k==0) {

fact[n]=k; n++; } }

if (n==0)

{

cout<

} else {

總結(jié)

以上是生活随笔為你收集整理的华南理工大学 高级程序设计语言 c++ ,2017华南理工大学网络教育《高级语言程序设计C++》平时作业...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。