1 2 3 4 5 6 7 8 9101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 | import java.util.Scanner;public class SumMatrices { private Scanner tec; private int[][] matrizA; private int[][] matrizB; private int[][] matrizC; public void CargarElementos(){ tec = new Scanner(System.in); matrizA = new int[2][2]; matrizB = new int[2][2]; System.out.println("Ingrese los elementos de la matriz A: \n"); System.out.println("Ingrese el elemento a11 de la matriz"); matrizA[0][0] = tec.nextInt(); System.out.println("Ingrese el elemento a12 de la matriz"); matrizA[0][1] = tec.nextInt(); System.out.println("Ingrese el elemento a21 de la matriz"); matrizA[1][0] = tec.nextInt(); System.out.println("Ingrese el elemento a22 de la matriz"); matrizA[1][1] = tec.nextInt(); //Matriz A: System.out.println("A= " + matrizA[0][0] + " " + matrizA[0][1]); System.out.println(" " + matrizA[1][0] + " " + matrizA[1][1]); //---------------------------------------------------------------- System.out.println("\nIngrese los elementos de la matriz B: \n"); System.out.println("Ingrese el elemento b11 de la matriz"); matrizB[0][0] = tec.nextInt(); System.out.println("Ingrese el elemento b12 de la matriz"); matrizB[0][1] = tec.nextInt(); System.out.println("Ingrese el elemento b21 de la matriz"); matrizB[1][0] = tec.nextInt(); System.out.println("Ingrese el elemento b22 de la matriz"); matrizB[1][1] = tec.nextInt(); //Matriz B: System.out.println("B= " + matrizB[0][0] + " " + matrizB[0][1]); System.out.println(" " + matrizB[1][0] + " " + matrizB[1][1]); //----------------------------------------------------------------- } public void Suma(){ matrizC = new int[2][2]; matrizC[0][0] = matrizA[0][0] + matrizB[0][0]; matrizC[0][1] = matrizA[0][1] + matrizB[0][1]; matrizC[1][0] = matrizA[1][0] + matrizB[1][0]; matrizC[1][1] = matrizA[1][1] + matrizB[1][1]; } public void Imprimir(){ System.out.println("La Suma de ambas matrices es: \n"); //Matriz C: System.out.println("C= " + matrizC[0][0] + " " + matrizC[0][1]); System.out.println(" " + matrizC[1][0] + " " + matrizC[1][1]); //----------------------------------------------------------------- System.out.println("\n Elementos de la matriz C: \n"); System.out.println("Elemento c11: " + matrizC[0][0]); System.out.println("Elemento c12: " + matrizC[0][1]); System.out.println("Elemento c21: " + matrizC[1][0]); System.out.println("Elemento c22: " + matrizC[1][1]); } public static void main(String[] ar){ SumMatrices sm = new SumMatrices(); sm.CargarElementos(); sm.Suma(); sm.Imprimir(); }} |
private int[][] matrizA;private int[][] matrizB;private int[][] matrizC;
matrizA = new int[2][2];matrizB = new int[2][2];
public void Suma(){ matrizC = new int[2][2]; matrizC[0][0] = matrizA[0][0] + matrizB[0][0]; matrizC[0][1] = matrizA[0][1] + matrizB[0][1]; matrizC[1][0] = matrizA[1][0] + matrizB[1][0]; matrizC[1][1] = matrizA[1][1] + matrizB[1][1];}
Psd to WordPress AUTO ACCIDENT ATTORNEY Computer science classes online personal injury law firm maritime lawyer houston Casino reviews Business VOIP Solutions Online Criminal Justice Degree asbestos exposure lawyers harddrive data recovery services motorcycle accident attorney chicago Donate Old Cars to Charity Online casino Donating a car in Maryland Mobile casino Casino Live casino Psd to html mesothelioma attorneys cheaper insurance companies How to Donate A Car in California Custom WordPress theme designer Donate a car in Maryland Best social media platforms for business WEBEX COSTS Criminal Defense Attorneys Florida Dwi lawyer Hire php developers auto accident attorney Torrance Make money online Australia Online Christmas cards mesotheioma Seo companies Photo Christmas cards Hire php developer Holland Michigan College mesothelioma attorney directory DONATE YOUR CAR FOR MONEY google affiliate WordPress theme designers AUTOMOBILE ACCIDENT ATTORNEY structured settlement broker Service business software Better conferencing calls selling structured settlement mesothelioma law suit EMAIL BULK SERVICE mesothelioma lawyer houston Massage School Dallas Texas asbestos lawyers DUI lawyer Hire php programmers CHEAP AUTO INSURANCE IN VA Html email best mesothelioma lawyers Criminal lawyer Donate your car for money Auto Mobile Shipping Quote Email Bulk Service low credit line credit cards New social media platforms best consolidation loan student Virtual Data Rooms orlando criminal attorney Sell Annuity Payment Social media strategies car insurance companies CAR INSURANCE QUOTES UTAH colorado mesothelioma lawyers Php programmers for hire HOW TO DONATE A CAR IN CALIFORNIA Criminal defense lawyer buy structured settlements DONATE CARS IN MA google adsense Donate old cars to charity Insurance Companies WebEx costs Paperport Promotional Code car accident lawyers Bankruptcy lawyer SELL ANNUITY PAYMENT Car Insurance Quotes Colorado CAR INSURANCE QUOTES PA federal criminal defense attorney Php programmers Adobe illustrator classes california motorcycle accident lawyer Met auto NEUSON hosted predictive dialers illinois law lemon Social media platforms Best social media platforms purchase structured settlements onlineclasses alcohol rehab center in florida Online colledges Business finance group Forex Trading Platform Mesothelioma Law Firm ONLINE MOTOR INSURANCE QUOTES mesothelioma lawyer virginia life insurance quotes Social media platforms for business Home Phone Internet Bundle FUTURISTIC ARCHITECTURE Business management software Seo services CAR DONATE WordPress hosting HOME PHONE INTERNET BUNDLE cash out structured settlement CAR INSURANCE IN SOUTH DAKOTA Best Seo company personal injury solicitor Cheap Auto Insurance in VA Motor Replacements structured settlement purchasers Seo company Custom Christmas cards DALLAS MESOTHELIOMA ATTORNEYS car insurance quotes mesothelioma Insurance WordPress themes for designers personal injury attorney ocala fl DONATING A CAR IN MARYLAND Social media examiner futuristic architecture truck accident attorney texas ANNUITY SETTLEMENT Social media management Tech school Car insurance quotes Colorado Attorney DONATE OLD CARS TO CHARITY dallas mesothelioma attorneys Cheap Domain Registration Hosting Christmas cards Proud Italian cook Italian cooking school Injury Lawyers Auto Accident Attorney DONATE CAR FOR TAX CREDIT pharmacist jobs in chicago Learning adobe illustrator PhD in counseling education mesothelioma information auto accident lawyer san francisco Social media tools Donate cars Illinois california law lemon how to donate a car in california Social media campaigns mesotheloma Donate car for tax credit Car Insurance Companies baltimore mesothelioma attorneys donating used cars to charity Asbestos Lawyers Donate Car to Charity California Donate Car for Tax Credit PHD on Counseling Education structered settlement Donate Cars in MA Donate Your Car Sacramento washington mesothelioma attorney injury lawyers mesothelioma symptoms caraccidentlawyer mesothelioma ct Donate Your Car for Kids Structures Annuity Settlement Online Colleges Annuity Settlements Nunavut Culture Cheap Car Insurance for Ladies Dayton Freight Lines motorcycle lawyer los angeles mesothelioma lawyers san diego Car Insurance Quotes Utah Hard drive Data Recovery Services Car Insurance Quotes PA Donate a Car in Maryland Mortgage Adviser colorado auto accident attorney Donating a Car in Maryland emergency response plan ppt Donate Cars Illinois Best Criminal Lawyers in Arizona buying structured settlements Life Insurance Co Lincoln tennessee mesothelioma lawyer Online Motor Insurance Quotes auto accident attorney boulder personal injury lawyers quotes car Online Classes HARDDRIVE DATA RECOVERY SERVICES World Trade Center Footage Personal Injury Lawyer Car insurance quotes Utah car accident lawyers west palm beach Psychic for Free Low Credit Line Credit Cards Dallas Mesothelioma Attorneys Car Insurance Quotes MN Donate your Car for Money CAR ACCIDENT LAWYERS motor insurance quotes Register Free Domains Met Auto Forensics Online Course MASSAGE SCHOOL DALLAS TEXAS Donating Used Cars to Charity Neuson REGISTER FREE DOMAINS Royalty Free Images Stock Psychic for free Car Insurance in South Dakota saskatchewan auto insurance CHEAP CAR INSURANCE FOR LADIES compare life assurance illinois mesothelioma lawyer Webex Costs Cheap Car Insurance in Virginia Better Conference Calls Futuristic Architecture ashely madis Dallas mesothelioma attorneys Car Donate Online College Course mesothelioma lawyer california Car Accident Lawyers Automobile Accident Attorney business email web hosting mesothelioma lawyer asbestos cancer lawsuit Online motor insurance quotes car crash attorneys Data Recovery Raid Criminal lawyer Miami Motor Insurance Quotes Personal Injury Lawyers Car Insurance Quotes ASBESTOS LAWYERS average mesothelioma settlement mesothelioma law firm Asbestos Lung Cancer Online Stock Trading
mesothelioma suit Blogging Making Money online Claim mesothelioma claim Health Business Loans structured settlement annuity companies Credit Software UK Canada Transfer Classes · Car Donate Cooking Recipes Insurance Nunavut culture · Car Accident Lawyers MOTORCYCLE ACCIDENT ATTORNEY LOS ANGLES Trading SELLING A STRUCTURED SETTLEMENT ANNUITY Mortgage Coupons Student Loans DAYTON FREIGHT LINES Attomey Online casino structured settlements annuities Recovery Online Colleges Degree benchmark lending ACCIDENT AND INJURY ATTORNEY ANNUITY SETTLEMENT CRIMINAL DEFENSE ATTORNEY PALM BEACH Blogs Based On Donations Donate Lawyer iPage Donate car for tax credit Automobile Accident Attorney Hosting Insurance Blogs Rehab Treatment STRUCTURED ANNUITY SETTLEMENT Conference Call Cord Blood Donate Car to Charity California Attormey Gas/Electricity Mesothelioma Law Firm hair removal washington dc Digital Photography Politics Donate Car for Tax Credit Bluehost Donate your car for kids Dreamhost NUNAVUT CULTURE mesothelioma survival rates mesothelioma attorneys california structured settlement buyer
No hay comentarios:
Publicar un comentario