Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package SFG;
- import java.util.Scanner;
- public class sfg {
- int[][] adjMatrix;
- private void inputs(){
- Scanner scan = new Scanner(System.in);
- System.out.print("Enter The Number Of Nodes : ");
- int NumOfNodes = scan.nextInt();
- adjMatrix = new int[NumOfNodes][NumOfNodes];
- System.out.println("To Get Out From Entering Signal Flow Graph Representation");
- System.out.println("Put From = 0 ");
- while(true){
- int from,to,gain;
- System.out.print("From : ");
- from = scan.nextInt() - 1;
- if(from < 0){
- break;
- }
- System.out.print("To : ");
- to = scan.nextInt() - 1;
- System.out.print("gain : ");
- gain = scan.nextInt();
- adjMatrix[to][from] = gain;
- }
- }
- public static void main(String[] args) {
- sfg g = new sfg();
- g.inputs();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement