Skip to content

Instantly share code, notes, and snippets.

@modos
Created July 11, 2021 17:02
Show Gist options
  • Save modos/8e344822aed07d38c09dff93c61770f8 to your computer and use it in GitHub Desktop.
Save modos/8e344822aed07d38c09dff93c61770f8 to your computer and use it in GitHub Desktop.
سوال نفس گیر
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int sum = 0;
int a[n];
int b[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < n; i++) {
cin >> b[i];
}
for (int i = 0; i < n; i++) {
sum = sum + a[i] * b[i];
}
cout << sum;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment