專案十練習1

2021-10-22 10:28:50 字數 909 閱讀 6498

題目:

建立乙個類, 用來表示「玩具」

文具, 有以下資料:

名稱,**,產地。

在使用中,需要獲取它的名稱, **, 產地。

注意:根據自己當前的優惠情況,有乙個對外的**

實現:

1. 標頭檔案

#pragma once

#include

using

namespace std;

class

toy;

2. 實現方法

#include

"toy.h"

#include

#include

toy::

toy(string name,

int price, string productplace)

string toy::

getname()

const

int toy::

getprice()

const

string toy::

getproductplace()

const

string toy::

descripiton()

const

void toy::

setdiscount

(float discount)

3. 呼叫

#include

#include

"toy.h"

intmain()

Python練習例項專案(1)建議收藏

題目 有四個數字 1 2 3 4,能組成多少個互不相同且無重複數字的三位數?各是多少?程式分析 可填在百位 十位 個位的數字都是1 2 3 4。組成所有的排列後再去 掉不滿足條件的排列。程式源 usr bin python coding utf 8 for i in range 1 5 for j ...

第十周 專案 1 驗證演算法 (1)

煙台大學計算機學院 檔名稱 xiangmu.cpp 完成日期 2017年12月7日 問題描述 層次遍歷演算法的驗證 輸入描述 無 輸出描述 層次遍歷樹的結果 include define maxsize 100 typedef char elemtype typedef struct node bt...

Rust 練習專案

tag rust,rust 練習專案,rust 練手專案 眾多 rust 初學者在學完 the rust programming language 後都會有疑問 接下來如何更進一步使用 rust?以下是從網際網路上收集到的一些用於學習 rust 專案,僅供參考。並會不定時更新。學習重在實踐,不要貪多...