⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 regles_etudiants_2

📁 这是用prolog写的几个程序:程序1是一个旅行社关系系统
💻
字号:




/*preparer(x,y)->rule(notes(x,y,z),nil)
		assert(noteutile(x,y,z),nil)
		fail; */

preparer(x,y)-> notes(x,y,z)
		asserta(noteutile(x,y,z),nil)
		fail;
preparer(x,y)->;


somme(x,y,s,n)-> retract (noteutile(x,y,z),nil) 
                 !
		 somme(x,y,s1,n1)
		 val(add(s1,z),s)
		 val(add(n1,1),n);
somme(x,y,0e0,0)->;


calculer(x,y,m)->somme(x,y,s,n)
		val(div(s,n),m);


effacer->retract(noteutile(x,y,z),nil)
		fail;
effacer->;

moyenne(x,y,m)->effacer
		preparer(x,y)
	   	calculer(x,y,m);

afficher_moyenne(x,y) -> moyenne(x,y,m) 
                val(round(100*m),m2)
                val(m2 / 100,e)
                val(m2 mod 100,d)
                etudiant(x,p,n)
                outm("l'閠udiant ") out (p) 
                outm (" ") out (n) outm (" a ")
                out(e) outm(",") 
                out_si_inf(d,10,0)
                out(d) 
                outm (" de moyenne en ") 
 		out (y) line ;

out_si_inf (n0, n1, x) ->
   val(n0 '<' n1, 1)
   out(x)
   ! ;
out_si_inf (n0, n1, x) -> ;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -