LoginSignup
0
1

More than 5 years have passed since last update.

C++のプログラムについてです

Posted at

1〜9までの数値を入力して入力した値の倍数と入力した値がついている値(1〜99まで)を表示して総和を求めるプログラム

int 総和 = 0;
for ( int i = 1; i < 100; ++i ) {
if ( 入力値がiで割り切れる || iの一の位が入力値と一致する || iの十の位が入力値と一致する ) {
i を出力する
i を総和に加える
}
}
総和を出力する

自分で考えてみましたがこれをプログラムにして欲しいです。お願いします🙇

0
1
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1