如何編寫個(gè)浪漫點(diǎn)的程序
package test1;
public class Calculatetimes {
?? ?public static void main(String[] args) {
?? ??? ?String s="hahahasongliaiwulleihahahaha";
?? ??? ?int num=0;
?? ??? ?// TODO Auto-generated method stub
for(int i=0;i<s.length();i++)
{if(s.charAt(i)=='a')
?? ?{num++;}}
?? ?System.out.println("字符a出現(xiàn)的次數(shù):"+num);
?? ?}
}
2016-11-25
用*號打印一個(gè)心形?
2016-08-19
使用格式化代碼快捷鍵:ctrl+shift+f
2016-08-18
public class Calculatetimes {
?? ?public static void main(String[] args) {
?? ?System.out.println("浪漫點(diǎn)的程序");
?? ?}
}
希望對你有幫助