How to Submit JavaScript/NodeJs Solution on Codeforces || কোডফোর্সেস এ কীভাবে জাভাস্ক্রিপ্ট/নোডজেএস সলিউশন সাবমিট করব



JavaScript is a very popular programming language. Its popularity is increasing day by day. Website work is done with JavaScript. And to increase the skills in JavaScript, everyone is now interested in solving various online jazz problems with JavaScript. But many do not know how to submit JavaScript solution. That's why you have to wear a lot of trouble often. So today I will show you how to submit a JavaScript solution. In this tutorial, I will show you how to submit a JavaScript solution to the popular online judge Codeforces.

 

Something about JavaScript:

JavaScript is an object-oriented, dynamic programming language. It has data type, operator, some important objects (which you can use all the time) and functions or methods. Good news for those who are proficient in Java RC programming language by borrowing some syntax! However, one of the major differences between JavaScript and many other languages ​​is that it does not have a class, but rather a new concept called "prototype". Another big difference is that any "function" in JavaScript is actually a single object! You can put code in the function, you can also pass the code from one place to another like an object. JavaScript is the most popular scripting language used on the Internet. JavaScript is a client-side scripting or browser scripting language. JavaScript (abbreviated as JS) is a prototype-based scripting language that has variable, weak type, and first-class functions. It is a language that supports an object oriented, functional programming style.

 

How to submit JavaScript solution:

1) First you need to download "jsshell".

Download link: https://ftp.mozilla.org/pub/firefox/releases/64.0/jsshell/

If you go to the link, you will get 5 files. The first two files are for Linux. 3rd for Mac OS. For the last two windows. If your Windows is 64 bit, download file number 5.

Then extract the file. Once extracted, you will find an application called "js". Run the application by double clicking once.

 


Then create a folder in this place where you can put or write your code.

 

2) Once your code is written, copy and paste your code in the main function of the code below.

 

"use strict";

process.stdin.resume ();

process.stdin.setEncoding ("utf-8");

 

function print (x)

  console.log (x);

}

let inputString = "";

let currentLine = 0;

 

process.stdin.on ("data", (inputStdin) =>

  inputString + = inputStdin;

});

process.stdin.on ("end", () =>

  inputString = inputString.split ("n");

  main ();

});

function readline ()

  return inputString [currentLine ++];

}

 

function main ()

// ************************* Paste your code here ******************** *******

}

 

Then copy the whole code and paste it in the editor of Codeforces and select the language “Node.js 12.3” and submit.



 

If the code you write is correct, your solution will be accepted.

 

Thank you 😊



-----------------------------------------------------------------------------------------------------------------------------

Video Tutorial


-----------------------------------------------------------------------------------------------------------------------------


জাভাস্ক্রিপ্ট হলো খুবই জনপ্রিয় একটি প্রোগ্রামিং ভাষা। দিনে দিনে এর জনপ্রিয়তা বেড়েই চলেছে। জাভাস্ক্রিপ্ট দিয়ে ওয়েবসাইটের কাজ করা হয়ে থাকে। আর জাভাক্রিপ্ট এ দক্ষতা বাড়াতে সবাই এখন বিভিন্ন অনলাইন জাজের প্রবলেম সলভ জাভাস্ক্রিপ্ট দিয়ে করতে আগ্রহী হচ্ছে। কিন্তু কীভাবে জাভাস্ক্রিপ্ট এর সলিউশন সাবমিট করতে হয় তা অনেকে জানে না। এজন্য অনেক ঝামেলায় পরতে হবে প্রায়সময়। তাই আজকে আমি দেখাবো কীভাবে জাভাস্ক্রিপ্ট সলিউশন সাবমিট করতে হয়। আমি এই টিউটোরিয়াল এ জনপ্রিয় অনলাইন জাজ কোডফোর্সেস এ জাভাস্ক্রিপ্ট সলিউশন সাবমিট করা দেখাব।

 

জাভাস্ক্রিপ্ট নিয়ে কিছু কথাঃ

জাভাস্ক্রিপ্ট একটি ওবজেক্ট-ওরিয়েন্টেড, ডায়নামিক প্রোগ্রামিং ভাষা। এতে আছে ডেটা টাইপ, অপারেটর, গুরুত্বপূর্ণ কিছু অবজেক্ট (যেগুলো সব সময় আপনি ব্যবহার করতে পারবেন) আর ফাংশন বা মেথড। জাভা আর সি প্রোগ্রামিং ভাষা থেকে বেশ কিছু সিন্ট্যাক্স ধার করে নেওয়ায় যারা এসব ভাষায় পারদর্শী তাদের জন্য সুখবর আরকি! তবে অন্য অনেক ভাষার সাথে জাভাস্ক্রিপ্ট এর একটা বড় পার্থক্য হল এতে কোন ক্লাস (class) নেই, বরং "প্রটোটাইপ" নামের নতুন এক ধারণা কে কাজে লাগিয়ে ক্লাস এর কাজ কর্ম করা হয়ে থাকে। আরো একটা বড় পার্থক্য হল জাভাস্ক্রিপ্ট যেকোন "ফাংশন" আসলে একেককটি অবজেক্ট! ফাংশনে আপনি কোড রাখতে পারবেন, আরো পারবেন অবজেক্টের মত কোডের এক জায়গা থেকে আরেক জায়গায় পাস (pass) করাতে। জাভাস্ক্রিপ্ট ইন্টারনেটে ব্যবহৃত সবচেয়ে জনপ্রিয় স্ক্রিপ্টিং ল্যাংগুয়েজ। জাভাস্ক্রিপ্ট হল একটি ক্লায়েন্ট সাইড স্ক্রিপ্টিং বা ব্রাউজার স্ক্রিপ্টিং ল্যাংগুয়েজ। জাভাস্ক্রিপ্ট (সংক্ষেপে JS বলা হয়) একটি প্রোটোটাইপ-ভিত্তিক স্ক্রিপ্টিং ল্যাংগুয়েজ যাতে পরিবর্তনশীল, দুর্বল টাইপ এবং প্রথম শ্রেণীর ফাংশন আছে। এটি একটি অবজেক্ট ওরিয়েন্টেড, কার্যকরী প্রোগ্রামিং শৈলী সমর্থনকারী ভাষা।

 

জাভাস্ক্রিপ্ট সলিউশন সাবমিট করার উপায়ঃ

১) প্রথমে আপনাকে “jsshell” ডাউনলোড করে নিতে হবে।

ডাউনলোড লিঙ্কঃ https://ftp.mozilla.org/pub/firefox/releases/64.0/jsshell/

লিঙ্ক এ গেলে আপনি ৫টি ফাইল পাবেন। প্রথম ফাইল দুইটি লিনাক্স এর জন্য। ৩য় টি ম্যাক ওস এর জন্য। শেষের দুইটি উইন্ডোজ এর জন্য। আপনার উইন্ডোজ টি ৬৪ বিটের হয়ে থাকলে ৫ নাম্বার ফাইল টি নামিয়ে নিন।

তারপর ফাইল্ টি এক্সট্রাক্ট করুন। এক্সট্রাক্ট হয়ে গেলে সেখানে “js” নামের একটি অ্যাপ্লিকেশন পাবেন। অ্যাপ্লিকেশন টি একবার ডাবল ক্লিক করে রান করিয়ে নিন।



তারপর এই জায়গাতেই একটি ফোল্ডার তৈরি করুন যেখানে আপনার কোড গুলো রাখবেন বা লিখবেন।

 

২) আপনার কোড লেখা হয়ে গেলে নিচের কোডের মেইন ফাংশনে আপনার কোডটি কপি করে পেস্ট করে দিন।

 

"use strict";

process.stdin.resume ();

process.stdin.setEncoding ("utf-8");

 

function print (x)

  console.log (x);

}

let inputString = "";

let currentLine = 0;

 

process.stdin.on ("data", (inputStdin) =>

  inputString + = inputStdin;

});

process.stdin.on ("end", () =>

  inputString = inputString.split ("n");

  main ();

});

function readline ()

  return inputString [currentLine ++];

}

 

function main ()

// ************************* Paste your code here ******************** *******

}

তারপর পুরো কোড টি কপি করে কোডফোর্সেস এর এডিটরে গিয়ে পেস্ট করে দিন আর ভাষা “Node.js 12.3” সিলেক্ট করে সাবমিট করে দিন ।



ব্যাস আপনার লেখা কোডটি ঠিকঠাক থাকলে আক্সেপ্টেড হয়ে যাবে আপনার সলিউশনটি।

 

ধন্যবাদ 😊


Code:

"use strict";

process.stdin.resume ();

process.stdin.setEncoding ("utf-8");

function print (x)

  console.log (x);

}

let inputString = "";

let currentLine = 0;

process.stdin.on ("data", (inputStdin) =>

  inputString + = inputStdin;

});

process.stdin.on ("end", () =>

  inputString = inputString.split ("n");

  main ();

});

function readline ()

  return inputString [currentLine ++];

}


function main ()

// ************************* Paste your code here ******************** *******

}



Next Post Previous Post
No Comment
Add Comment
comment url