とりあえずベースとしているもの
変数でバーコードのコード12桁部分がstring型で渡されているとします。barcode
for(idx = 0; idx < barcode.Length; idx++){
if(idx % 2 == 0) { //奇数桁
var chr = barcode.Substring(idx, 1);
oddSum += Integer.Parse(chr);
}
}
とりあえずベースとしているもの
変数でバーコードのコード12桁部分がstring型で渡されているとします。barcode
for(idx = 0; idx < barcode.Length; idx++){
if(idx % 2 == 0) { //奇数桁
var chr = barcode.Substring(idx, 1);
oddSum += Integer.Parse(chr);
}
}
senooken JP Social is a social network, courtesy of senooken. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.
All senooken JP Social content and data are available under the Creative Commons Attribution 3.0 license.