結果

問題 No.167 N^M mod 10
ユーザー itezpace
提出日時 2016-07-25 17:45:09
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 227 bytes
コンパイル時間 675 ms
コンパイル使用メモリ 55,988 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-06 16:21:45
合計ジャッジ時間 1,802 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:9: warning: ‘a’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   16 |   cout<<a<<endl;
      |         ^

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
  int n,m,mod;
  mod=10;
  cin>>n;
  cin>>m;
  int a,b,c;
  for(int i=0; i<m; ++i){
    int b;
    b=n%mod;
    c=n%mod;
    a=(b*c)%mod;
  }
  cout<<a<<endl;
  return 0;
}
0