This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fname = raw_input("Enter file name: ") | |
fh = open(fname) | |
lst = list() # list for the desired output | |
for line in fh: # to read every line of file romeo.txt | |
word= line.rstrip().split() # to eliminate the unwanted blanks and turn the line into a list of words | |
for element in word: # check every element in word | |
if element in lst: # if element is repeated | |
continue # do nothing | |
else : # else if element is not in the list | |
lst.append(element) # append |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package oot.lab4.group1; | |
import java.util.Scanner; | |
public class No1 { | |
public static int[] genArrayA(int num) { | |
int[] a = new int[num]; | |
int n = 0; | |
int i = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.Scanner; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
int[][] array = new int[in.nextInt()][in.nextInt()]; | |
for (int i = 0; i < array.length; i++) { | |
for (int j = 0; j < array[i].length; j++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class TwoDArrayInput{ | |
public static void main(String args[]){ | |
System.out.print("Enter 2D array size : "); | |
Scanner sc=new Scanner(System.in); | |
int rows=sc.nextInt(); | |
int columns=sc.nextInt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package oot.lab4.group1.y58; | |
import java.util.Scanner; | |
public class No1 { | |
public static int[] genArrayA(int size) { | |
int[] a = new int[size]; | |
int n = 20; | |
int i = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author: Asif Ahmed | |
* Site: http://quickgrid.blogspot.com | |
* Description: C++ easy Graph BFS Traversal with shortest path finding for undirected graphs | |
* and shortest path retracing thorough parent nodes. | |
*/ | |
#include<bits/stdc++.h> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sdk.algo; | |
import java.util.Arrays; | |
import java.util.Scanner; | |
/** | |
* http://59.23.113.171/pool/koi_budget/koi_budget.php?pname=koi_budget | |
* 더블릿, 예산 | |
* | |
* @author whitebeard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fhand = open("mbox-short.txt") | |
count = 0 | |
for line in fhand: | |
line = line.rstrip() | |
if line == "": continue | |
words = line.split() | |
if words[0] !="From": continue | |
print(words[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Scanner; | |
import javax.swing.JOptionPane; | |
import javax.swing.JTextArea; |
OlderNewer