-
07-17-2014, 07:00 AM #11Junior Member
- Ngày tham gia
- May 2015
- Bài viết
- 5
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>nop bai (move your mouse to reveal the content)</noscript>
nop bai (open)
nop bai (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]bufferedreader[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]filereader[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]filewriter[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]ioexception[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]inputstreamreader[/color][color=#007700]; public class [/color][color=#0000bb]coppyfile [/color][color=#007700]{ @[/color][color=#0000bb]suppresswarnings[/color][color=#007700]([/color][color=#dd0000]"resource"[/color][color=#007700]) public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) [/color][color=#0000bb]throws ioexception [/color][color=#007700]{ [/color][color=#ff8000]//copy file input.txt sang file output.txt su dung cach doc van ban //doc file [/color][color=#0000bb]bufferedreader br [/color][color=#007700]= new [/color][color=#0000bb]bufferedreader[/color][color=#007700](new [/color][color=#0000bb]inputstreamreader[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700])); [/color][color=#0000bb]filewriter fw[/color][color=#007700]; [/color][color=#0000bb]string tenfile[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập đường dẫn file:"[/color][color=#007700]); [/color][color=#0000bb]tenfile [/color][color=#007700]= [/color][color=#0000bb]br[/color][color=#007700].[/color][color=#0000bb]readline[/color][color=#007700](); [/color][color=#0000bb]filereader fr [/color][color=#007700]= new [/color][color=#0000bb]filereader[/color][color=#007700]([/color][color=#0000bb]tenfile[/color][color=#007700]); [/color][color=#0000bb]bufferedreader b [/color][color=#007700]= new [/color][color=#0000bb]bufferedreader[/color][color=#007700]([/color][color=#0000bb]fr[/color][color=#007700]); [/color][color=#0000bb]string s[/color][color=#007700]; [/color][color=#ff8000]//doc tung dong van ban [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].print([/color][color=#dd0000]"nhập đường dẫn file luu:"[/color][color=#007700]); [/color][color=#0000bb]tenfile [/color][color=#007700]= [/color][color=#0000bb]br[/color][color=#007700].[/color][color=#0000bb]readline[/color][color=#007700](); [/color][color=#0000bb]fw [/color][color=#007700]= new [/color][color=#0000bb]filewriter[/color][color=#007700]([/color][color=#0000bb]tenfile[/color][color=#007700]); while(([/color][color=#0000bb]s [/color][color=#007700]= [/color][color=#0000bb]b[/color][color=#007700].[/color][color=#0000bb]readline[/color][color=#007700]()) != [/color][color=#0000bb]null[/color][color=#007700]) { [/color][color=#0000bb]s [/color][color=#007700]= [/color][color=#0000bb]s [/color][color=#007700]+ [/color][color=#dd0000]"
"[/color][color=#007700]; [/color][color=#0000bb]fw[/color][color=#007700].[/color][color=#0000bb]write[/color][color=#007700]([/color][color=#0000bb]s[/color][color=#007700]); } [/color][color=#ff8000]//ghi file [/color][color=#0000bb]fw[/color][color=#007700].[/color][color=#0000bb]close[/color][color=#007700](); }}[/color]
</div>
</div>
-
08-14-2014, 07:00 AM #12Member
- Ngày tham gia
- Jul 2015
- Bài viết
- 61
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>spoiler (move your mouse to the spoiler area to reveal the content)</noscript>
show spoiler
hide spoiler
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã:ackage $31docghidlieudungluongkytu; import java.io.bufferedreader; import java.io.filereader; import java.io.filewriter; import java.io.ioexception; public class baitap { public static void main(string[] args) { try{ filereader fr=new filereader("d:\\vy2301.txt"); bufferedreader br=new bufferedreader(fr); filewriter fw=new filewriter("d:\\vynhat.txt"); string s; while((s=br.readline())!=null){ fw.write(s); system.out.println(s); } fr.close(); fw.close(); }catch(ioexception e1){ system.out.println(e1); } } }
</div>
</div>
-
09-17-2014, 07:00 AM #13Junior Member
- Ngày tham gia
- Mar 2015
- Bài viết
- 0
<div class="bbcodeblock bbcodequote bbcmspoilerblock">
<div class="attribution type"><noscript>bai31 -doc ghi file dung luong ki tu trong java (move your mouse to reveal the content)</noscript>
bai31 -doc ghi file dung luong ki tu trong java (open)
bai31 -doc ghi file dung luong ki tu trong java (close)
</div>
<div class="quotecontent">
<div class="bbcm_spoiler_noscript"><blockquote>
Mã nguồn PHP:[color=#000000]
bai31package baitapvenha[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]bufferedreader[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]filenotfoundexception[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]filereader[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]filewriter[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]ioexception[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]util[/color][color=#007700].[/color][color=#0000bb]scanner[/color][color=#007700];[/color][color=#ff8000]/*** viết chương trình copy nội dung file "input.txt" sang file "output.txt" sử* dụng cách đọc ghi văn bản! bạn nào làm xong cố gắng bớt chút ít thời gian* đăng lên cho các bạn khác cùng tham khảo nhé!*/[/color][color=#007700]public class [/color][color=#0000bb]bai31 [/color][color=#007700]{ public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) [/color][color=#0000bb]throws ioexception [/color][color=#007700]{ [/color][color=#0000bb]scanner sc [/color][color=#007700]= new [/color][color=#0000bb]scanner[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700]); [/color][color=#0000bb]string part1[/color][color=#007700], [/color][color=#0000bb]part2[/color][color=#007700]; [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap duong dan file nguon ( start = :\\\\...\\*.*)"[/color][color=#007700]); [/color][color=#0000bb]part1 [/color][color=#007700]= [/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"nhap duong dan file dich ( start = :\\\\...\\*.*)"[/color][color=#007700]); [/color][color=#0000bb]part2 [/color][color=#007700]= [/color][color=#0000bb]sc[/color][color=#007700].[/color][color=#0000bb]nextline[/color][color=#007700](); [/color][color=#ff8000]/*part1 = "e:\\thongtinsv.txt"; part2 = "d:\\thongtinghilai.txt"; */ [/color][color=#0000bb]bai31 test [/color][color=#007700]= new [/color][color=#0000bb]bai31[/color][color=#007700](); [/color][color=#0000bb]test[/color][color=#007700].[/color][color=#0000bb]copyfile[/color][color=#007700]([/color][color=#0000bb]part1[/color][color=#007700], [/color][color=#0000bb]part2[/color][color=#007700]); } public [/color][color=#0000bb]void copyfile[/color][color=#007700]([/color][color=#0000bb]string part1[/color][color=#007700], [/color][color=#0000bb]string part2[/color][color=#007700]) [/color][color=#0000bb]throws ioexception [/color][color=#007700]{ [/color][color=#0000bb]filereader fr[/color][color=#007700]; [/color][color=#0000bb]filewriter fw [/color][color=#007700]= [/color][color=#0000bb]null[/color][color=#007700]; try { [/color][color=#0000bb]fr [/color][color=#007700]= new [/color][color=#0000bb]filereader[/color][color=#007700]([/color][color=#0000bb]part1[/color][color=#007700]); [/color][color=#0000bb]fw [/color][color=#007700]= new [/color][color=#0000bb]filewriter[/color][color=#007700]([/color][color=#0000bb]part2[/color][color=#007700]); [/color][color=#0000bb]bufferedreader br [/color][color=#007700]= new [/color][color=#0000bb]bufferedreader[/color][color=#007700]([/color][color=#0000bb]fr[/color][color=#007700]); [/color][color=#0000bb]string str[/color][color=#007700]; [/color][color=#ff8000]// doc tung dong van ban [/color][color=#007700]while (([/color][color=#0000bb]str [/color][color=#007700]= [/color][color=#0000bb]br[/color][color=#007700].[/color][color=#0000bb]readline[/color][color=#007700]()) != [/color][color=#0000bb]null[/color][color=#007700]) { [/color][color=#0000bb]str [/color][color=#007700]= [/color][color=#0000bb]str [/color][color=#007700]+ [/color][color=#dd0000]" "[/color][color=#007700]; [/color][color=#0000bb]fw[/color][color=#007700].[/color][color=#0000bb]write[/color][color=#007700]([/color][color=#0000bb]str[/color][color=#007700]); [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#0000bb]str[/color][color=#007700]); } } catch ([/color][color=#0000bb]filenotfoundexception e[/color][color=#007700]) { [/color][color=#ff8000]// todo auto-generated catch block [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#dd0000]"error: " [/color][color=#007700]+ [/color][color=#0000bb]e[/color][color=#007700]); } [/color][color=#0000bb]fw[/color][color=#007700].[/color][color=#0000bb]close[/color][color=#007700](); }}[/color]
</div>
</div>
-
10-04-2014, 07:00 AM #14Junior Member
- Ngày tham gia
- Apr 2015
- Bài viết
- 2
Gửi bởi bqthanh94_cntt
-
03-17-2015, 07:00 AM #15Junior Member
- Ngày tham gia
- Jan 2015
- Bài viết
- 0
// mong mọi người đóng góp ý kiến để mình hoàn thiện hơn
Mã nguồn PHP:[color=#000000]
import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]bufferedreader[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]filereader[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]filewriter[/color][color=#007700];[/color][color=#0000bb]import java[/color][color=#007700].[/color][color=#0000bb]io[/color][color=#007700].[/color][color=#0000bb]inputstreamreader[/color][color=#007700]; [/color][color=#ff8000]/*** created by whynotme on 16/03/2015.*/[/color][color=#007700]public class [/color][color=#0000bb]readwriteread [/color][color=#007700]{ public static [/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]readfile[/color][color=#007700]([/color][color=#0000bb]string url[/color][color=#007700]) { [/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]s [/color][color=#007700]= new [/color][color=#0000bb]string[/color][color=#007700][[/color][color=#0000bb]10[/color][color=#007700]]; [/color][color=#0000bb]int index [/color][color=#007700]= [/color][color=#0000bb]0[/color][color=#007700]; try { [/color][color=#0000bb]filereader fr [/color][color=#007700]= new [/color][color=#0000bb]filereader[/color][color=#007700]([/color][color=#0000bb]url[/color][color=#007700]); [/color][color=#0000bb]bufferedreader br [/color][color=#007700]= new [/color][color=#0000bb]bufferedreader[/color][color=#007700]([/color][color=#0000bb]fr[/color][color=#007700]); while (([/color][color=#0000bb]s[/color][color=#007700][[/color][color=#0000bb]index[/color][color=#007700]] = [/color][color=#0000bb]br[/color][color=#007700].[/color][color=#0000bb]readline[/color][color=#007700]()) != [/color][color=#0000bb]null[/color][color=#007700]) { [/color][color=#0000bb]index[/color][color=#007700]++; } } catch ([/color][color=#0000bb]exception e[/color][color=#007700]) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#0000bb]e[/color][color=#007700]); } return [/color][color=#0000bb]s[/color][color=#007700]; } public static [/color][color=#0000bb]void writefile[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]url[/color][color=#007700], [/color][color=#0000bb]string link[/color][color=#007700]) { [/color][color=#0000bb]filewriter fw[/color][color=#007700]; [/color][color=#0000bb]bufferedreader br [/color][color=#007700]= new [/color][color=#0000bb]bufferedreader[/color][color=#007700](new [/color][color=#0000bb]inputstreamreader[/color][color=#007700]([/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]in[/color][color=#007700])); try { [/color][color=#0000bb]fw [/color][color=#007700]= new [/color][color=#0000bb]filewriter[/color][color=#007700]([/color][color=#0000bb]link[/color][color=#007700]); for ([/color][color=#0000bb]int i [/color][color=#007700]= [/color][color=#0000bb]0[/color][color=#007700]; [/color][color=#0000bb]i [/color][color=#007700]< [/color][color=#0000bb]url[/color][color=#007700].[/color][color=#0000bb]length[/color][color=#007700]; [/color][color=#0000bb]i[/color][color=#007700]++) { if ([/color][color=#0000bb]url[/color][color=#007700][[/color][color=#0000bb]i[/color][color=#007700]] != [/color][color=#0000bb]null[/color][color=#007700]) { [/color][color=#0000bb]fw[/color][color=#007700].[/color][color=#0000bb]write[/color][color=#007700]([/color][color=#0000bb]url[/color][color=#007700][[/color][color=#0000bb]i[/color][color=#007700]]); } } [/color][color=#0000bb]fw[/color][color=#007700].[/color][color=#0000bb]close[/color][color=#007700](); } catch ([/color][color=#0000bb]exception e[/color][color=#007700]) { [/color][color=#0000bb]system[/color][color=#007700].[/color][color=#0000bb]out[/color][color=#007700].[/color][color=#0000bb]println[/color][color=#007700]([/color][color=#0000bb]e[/color][color=#007700]); } } public static [/color][color=#0000bb]void main[/color][color=#007700]([/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]args[/color][color=#007700]) { [/color][color=#0000bb]string intputfile [/color][color=#007700]= [/color][color=#dd0000]"e:\\input.txt"[/color][color=#007700]; [/color][color=#0000bb]string outfile [/color][color=#007700]= [/color][color=#dd0000]"e:\\output.txt"[/color][color=#007700]; [/color][color=#0000bb]string[/color][color=#007700][] [/color][color=#0000bb]file [/color][color=#007700]= [/color][color=#0000bb]readfile[/color][color=#007700]([/color][color=#0000bb]intputfile[/color][color=#007700]); [/color][color=#0000bb]writefile[/color][color=#007700]([/color][color=#0000bb]file[/color][color=#007700], [/color][color=#0000bb]outfile[/color][color=#007700]); }}[/color]
Dự án cao cấp Altara Residences Quy Nhơn được xây dựng bởi Công ty CP Foodinco Quy Nhơn hiện đại đẳng cấp đầy phong cách nhịp sống hài hòa. Altara Residences Quy Nhơn hiện đại đẳng cấp khu phát...
Chung cư cao cấp Altara Residences Quy Nhơn hệ thống đồng bộ