?? stamp.java
字號:
class CStamp_problem
{
int[] kinds=new int[27];
void printkinds()
{
//t:3分郵票張數(shù);f:5分郵票張數(shù);v:一種郵資的可能值
int t,f,v=0;
//i:郵資種類序員;n:郵資種類數(shù)
int i,n=0;
for(t=0;t<=4;t++)
for(f=0;f<=3;t++)
{
v=t*3+f*5;
for(i=0;kinds[i]!=0;i++)
if(v==kinds[i]) break;
if (kinds[i]==0&&v!=0)
{
kinds[i]=v;
n++;
}
}
System.out.println("kinds="+n);
for(i=0;kinds[i]!=0;i++)
System.out.println(i+" 's:"+kinds[i]);
}
}
public class Stamp
{
public static void main(String args[])
{
CStamp_problem s=new CStamp_problem();
s.printkinds();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -